/* ===== ADMIN STYLES ===== */
:root {
    --primary: #C8652A;
    --primary-dark: #A0501F;
    --text: #1a1a1a;
    --text-muted: #666;
    --text-light: #999;
    --bg: #f4f1ed;
    --bg-white: #ffffff;
    --border: #e5e0d8;
    --shadow: 0 2px 12px rgba(0,0,0,0.07);
    --radius: 8px;
    --sidebar-width: 240px;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: 15px; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: #1e1b16;
    color: rgba(255,255,255,0.75);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: white;
    font-weight: 600;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }

.sidebar-section {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0 8px;
    margin: 16px 0 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-link.active { background: var(--primary); color: white; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-link.logout { color: rgba(255,100,100,0.7); }
.sidebar-link.logout:hover { color: #ff6b6b; background: rgba(255,100,100,0.1); }

.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar h1 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; }

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.admin-main { padding: 28px; }

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow);
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label { font-size: 0.83rem; color: var(--text-muted); }

/* Table */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 { font-family: var(--font-serif); font-size: 1.1rem; }

.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }

.table-img {
    width: 44px; height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-primary { background: rgba(200,101,42,0.12); color: var(--primary); }
.badge-food { background: rgba(52,168,83,0.12); color: #2d7a3a; }
.badge-vino { background: rgba(142,36,170,0.12); color: #6a1b7a; }

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

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.93rem;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-full { grid-column: 1 / -1; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    color: currentColor;
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sidebar-brand .icon,
.login-logo .icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    padding: 8px;
}

.sidebar-link .icon {
    width: 18px;
    height: 18px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-img .icon {
    width: 1.2rem;
    height: 1.2rem;
}

.btn-icon .icon {
    width: 16px;
    height: 16px;
}

.btn-sm .icon {
    width: 14px;
    height: 14px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

/* Image preview */
.img-preview {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.image-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-zone:hover { border-color: var(--primary); }
.image-upload-zone input { display: none; }

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

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e1b16;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .emoji { font-size: 2.5rem; }

.login-logo h1 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-top: 8px;
}

.login-logo p { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 20px;
}

.page-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn.active, .page-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Delete confirm */
.confirm-delete { display: inline; }
.confirm-delete button { background: none; border: none; cursor: pointer; color: #e74c3c; font-size: 0.8rem; font-weight: 700; text-decoration: underline; }
