/* ============================================================
   Little Italy Speisekarten-Editor - Admin Styles
   Farben angelehnt an die Original-Speisekarte:
   Gold #AE8A47, Schwarz #000, Hellgrau #7A7A7A
   ============================================================ */

:root {
    --gold: #AE8A47;
    --gold-light: #C9A864;
    --gold-dark: #8B6D37;
    --black: #000000;
    --dark-gray: #333333;
    --mid-gray: #7A7A7A;
    --light-gray: #E8E8E8;
    --bg: #FAFAF8;
    --white: #FFFFFF;
    --danger: #B9252E;
    --success: #2F7A3B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-sm: 4px;
}

* { box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dark-gray);
    background: var(--bg);
    line-height: 1.5;
}

h1, h2, h3 {
    color: var(--black);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 0.5em;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--mid-gray); }

/* ============================================================
   Auth-Layout (Login / Setup)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2420 100%);
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 40px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--gold);
}

.auth-box h1 {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.auth-box .subtitle {
    text-align: center;
    color: var(--gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 32px;
}

.auth-box label {
    display: block;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.auth-box input[type="text"],
.auth-box input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.15s;
    font-family: inherit;
}

.auth-box input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(174, 138, 71, 0.15);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.02em;
    transition: background 0.15s, transform 0.05s;
    min-height: 44px;
}

.btn-primary {
    background: var(--gold);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: var(--gold-dark);
    text-decoration: none;
}

.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
    background: transparent;
    color: var(--dark-gray);
    border: 1px solid var(--light-gray);
}

.btn-secondary:hover {
    background: var(--light-gray);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
    min-width: 200px;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fdecea;
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #e8f5ec;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert .warning {
    margin-top: 10px;
    color: var(--danger);
    font-weight: 600;
}

.alert code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Consolas, monospace;
}

/* ============================================================
   Admin-Layout (Topbar + Container)
   ============================================================ */
.admin-page {
    padding-bottom: 60px;
}

.topbar {
    background: var(--black);
    color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    color: var(--white);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand:hover { text-decoration: none; }

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.topnav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.topnav a {
    color: var(--white);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: background 0.15s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.topnav a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.topnav a.active {
    background: var(--gold);
    color: var(--white);
}

.topnav a.logout {
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 8px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}

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

.page-header h1 {
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-header h1::after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background: var(--gold);
    margin-top: 8px;
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--mid-gray);
    font-size: 0.75rem;
}

/* ============================================================
   Dashboard - Page Grid
   ============================================================ */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.page-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.05s;
    display: flex;
    flex-direction: column;
}

.page-card:hover {
    box-shadow: var(--shadow-md);
}

.page-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 10px;
}

.page-number {
    font-weight: 700;
    color: var(--black);
    font-size: 0.95rem;
}

.page-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.page-badge-menu {
    background: rgba(174, 138, 71, 0.15);
    color: var(--gold-dark);
}

.page-badge-getraenke {
    background: rgba(26, 26, 26, 0.08);
    color: var(--black);
}

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-grow: 1;
}

.cat-list li { margin: 0; }

.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--light-gray);
    color: var(--dark-gray);
    font-size: 0.9rem;
    min-height: 44px;
}

.cat-list a:hover {
    color: var(--gold-dark);
    text-decoration: none;
}

.cat-list li:last-child a { border-bottom: none; }

.cat-title {
    flex-grow: 1;
    padding-right: 12px;
}

.cat-count {
    color: var(--mid-gray);
    background: var(--bg);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.page-card-foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--light-gray);
    color: var(--mid-gray);
}

.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 24px 0;
    border-top: 2px solid var(--gold);
    margin-top: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
/* ============================================================
   Item-Liste (Kategorie-View)
   ============================================================ */
.items-section {
    margin-top: 24px;
}

.items-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.items-section-head h2 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold-dark);
}

.items-section-head h2::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    width: 40px;
    height: 2px;
    background: var(--gold);
    margin-left: 10px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 4px;
}

.item-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    align-items: start;
    transition: background 0.12s;
}

.item-row + .item-row { border-top: 1px solid var(--light-gray); }
.item-row:hover { background: #fdfdfa; }
.item-inactive { opacity: 0.55; }

.item-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-reorder {
    width: 40px;
    height: 28px;
    border: 1px solid var(--light-gray);
    background: var(--white);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--mid-gray);
    transition: background 0.12s;
}

.btn-reorder:hover:not(:disabled) {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}

.btn-reorder:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reorder-form {
    display: contents;
}

.item-body { min-width: 0; }

.item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.item-name {
    color: var(--black);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.item-suffix {
    font-weight: 400;
    color: var(--mid-gray);
    font-size: 0.82rem;
    text-transform: none;
    margin-left: 4px;
}

.item-origin {
    font-weight: 400;
    color: var(--gold-dark);
    font-size: 0.82rem;
    text-transform: none;
}

.item-badge {
    background: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.item-price {
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.price-label {
    color: var(--mid-gray);
    font-weight: 400;
    font-size: 0.75rem;
}

.item-desc {
    margin: 4px 0 0;
    color: var(--gold-dark);
    font-size: 0.82rem;
    line-height: 1.4;
}

.item-allergens {
    color: var(--mid-gray);
    font-size: 0.75rem;
    margin-left: 4px;
}

.item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-form {
    display: inline;
    margin: 0;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 36px;
    min-width: 0;
}

/* ============================================================
   Notes-Box (Fuss-/Kopfnoten)
   ============================================================ */
.notes-box {
    background: #fdfbf5;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.notes-box h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--dark-gray);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.88rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-family: inherit;
}

.notes-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* ============================================================
   Item-Formular
   ============================================================ */
.item-form {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 24px;
}

.form-section {
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.form-section:last-of-type { border-bottom: none; }

.form-section h3 {
    margin-top: 0;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
}

.item-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.item-form label > span {
    display: block;
    margin-bottom: 4px;
}

.item-form input[type="text"],
.item-form select {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: inherit;
}

.item-form input:focus,
.item-form select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(174, 138, 71, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label-wide { grid-column: span 2; }

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    color: var(--dark-gray);
    padding-top: 28px;
}

.form-check input { width: auto; }
.form-check span { margin: 0; display: inline; }

.req { color: var(--danger); }

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: auto;
    min-width: 150px;
}

.item-id-hint {
    color: var(--mid-gray);
    font-size: 0.8rem;
    margin-left: auto;
}

.item-id-hint code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Consolas, monospace;
}

@media (max-width: 640px) {
    .topbar-inner {
        padding: 12px 16px;
    }

    .brand-name { font-size: 0.95rem; }
    .brand-sub { font-size: 0.65rem; }

    .topnav a {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .container {
        padding: 20px 16px;
    }

    h1 { font-size: 1.5rem; }

    .page-grid {
        grid-template-columns: 1fr;
    }

    .btn-large {
        width: 100%;
    }

    .auth-box {
        padding: 28px 20px;
    }

    .item-row {
        grid-template-columns: 40px 1fr;
    }

    .item-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 8px;
        border-top: 1px dashed var(--light-gray);
        margin-top: 6px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-label-wide { grid-column: span 1; }

    .form-check {
        padding-top: 0;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}
