/* ============================================
   GLOBAL BASE STYLES
============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    margin: 0;
    line-height: 1.5;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin: 0;
}

/* ============================================
   TOPBAR + SIDEBAR LAYOUT (APP PAGES)
   Works with header.php using .topbar, .layout,
   .sidebar, .content
============================================ */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: #111827;
    color: #e5e7eb;
}

.topbar a {
    color: #93c5fd;
}

.layout {
    display: flex;
    min-height: calc(100vh - 48px);
}

/* also support .wrapper / .main-content if used */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: #020617;
    color: #e5e7eb;
    padding: 16px 14px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    margin: 12px 2px 6px;
}

.nav-link {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.nav-link:hover {
    background: #1f2937;
}

.nav-link.active {
    background: linear-gradient(135deg, #2563eb, #22c55e);
    color: #f9fafb;
}

.content,
.main-content {
    flex: 1;
    padding: 20px 18px;
}

/* ============================================
   PAGE HEADERS
============================================ */

.page-header {
    margin-bottom: 16px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* ============================================
   CARDS (DASHBOARD COUNTERS)
============================================ */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    margin-bottom: 4px;
}

.card-value {
    font-size: 22px;
    font-weight: 700;
}

/* ============================================
   FORM BOXES
============================================ */

.form-box {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.04);
}

.form-box h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.form-box label {
    display: block;
    font-size: 13px;
    color: #4b5563;
    margin-top: 10px;
    margin-bottom: 4px;
}

.form-box input,
.form-box select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: #ffffff;
}

.form-box button {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.form-box button:hover {
    background: #030712;
    transform: translateY(-1px);
}

/* ============================================
   TABLES
============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 8px 10px;
    font-size: 13px;
}

th {
    background: #111827;
    color: #f9fafb;
    text-align: left;
}

tr:nth-child(even) td {
    background: #f9fafb;
}

tr:hover td {
    background: #eef2ff;
}

/* ============================================
   ALERTS
============================================ */

.success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #166534;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}
/* ============================================
   LOGIN PAGE (polished, mobile friendly)
============================================ */

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #2563eb 0, #020617 60%);
    padding: 16px;
}

.login-box {
    background: #ffffff;
    padding: 24px 26px 22px;
    border-radius: 18px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 20px 45px rgba(15,23,42,0.55);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
}

.login-box label {
    display: block;
    font-size: 11px;
    margin-top: 10px;
    margin-bottom: 4px;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* icon + input */
.input-row {
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 7px 11px;
    transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-row:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.45);
    background: #ffffff;
}

.input-row input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    color: #111827;
}

/* user / lock icon */
.icon-circle {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-circle svg {
    width: 15px;
    height: 15px;
    stroke: #4b5563;
    fill: none;
    stroke-width: 1.6;
}

/* eye toggle */
.eye-toggle {
    border: none;
    background: transparent;
    padding: 0;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.eye-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #9ca3af;
    fill: none;
    stroke-width: 1.6;
}

.eye-toggle.visible svg {
    stroke: #2563eb;
}

/* login button */
.login-box button[type="submit"] {
    width: 100%;
    margin-top: 18px;
    padding: 9px 13px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.login-box button[type="submit"]:hover {
    background: #030712;
    transform: translateY(-1px);
}

.hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
    text-align: center;
}

/* ============================================
   MENU PAGE (public + admin)
   White + warm brown + coal black palette
============================================ */

.menu-page {
    max-width: 1120px;
    margin: 0 auto;
}

/* hero */
.menu-hero {
    text-align: center;
    margin-bottom: 18px;
}

.menu-hero-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111827;           /* coal black */
}

.menu-hero-subtitle {
    font-size: 14px;
    color: #7c5b3c;           /* warm brown text */
    margin-top: 4px;
}

/* category pills */
.menu-category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 10px 0 20px;
}

.menu-category-pill {
    border-radius: 999px;
    border: 1px solid #d6bfa0;      /* soft brown border */
    background: #fdf7ee;            /* light cream */
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #4b3626;
    transition: background 0.15s, color 0.15s, border 0.15s, transform 0.1s;
}

.menu-category-pill:hover,
.menu-category-pill.active {
    background: #111827;            /* coal black */
    color: #fefce8;
    border-color: #111827;
    transform: translateY(-1px);
}

/* menu card grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

/* card with elegant hover */
.menu-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e5d4bd;
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
    display: flex;
    flex-direction: column;
    transform: translateY(0) scale(1);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.menu-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(15,23,42,0.24);
    border-color: #c28a4a;          /* accent brown */
}

/* image area */
.menu-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.menu-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card:hover .menu-image-wrapper img {
    transform: scale(1.07);
}

/* card body */
.menu-card-body {
    padding: 10px 13px 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: #111827;
}

.menu-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #7c5b3c;
}

.menu-category-label {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.7rem;
}

.menu-price {
    font-weight: 700;
    color: #111827;
}

/* actions for admin menu (Add to order / Delete) */
.menu-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.menu-add-btn {
    padding: 6px 11px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.menu-add-btn:hover {
    background: #000000;
}

.menu-delete-link {
    color: #b91c1c;
}

.menu-delete-link:hover {
    text-decoration: underline;
}

/* responsive tweaks */
@media (max-width: 640px) {
    .menu-hero-title {
        font-size: 24px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}
/* ============================================
   RESPONSIVE FOR MOBILE
============================================ */

@media (max-width: 900px) {
    .layout,
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px 10px;
    }

    .sidebar nav ul {
        display: flex;
        gap: 4px;
    }

    .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
    }

    .content,
    .main-content {
        padding: 16px 14px;
    }
}

@media (max-width: 640px) {
    .menu-hero-title {
        font-size: 24px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}