:root {
    --gold: #C8A97E;
    --gold-light: #E8D5B5;
    --gold-dark: #A68B5E;
    --dark: #1a1a1a;
    --cream: #f8f5f0;
    --white: #ffffff;
    --text: #333;
    --text-light: #777;
    --border: #e0d8d0;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--cream);
    line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.btn {
    display: inline-block;
    padding: 10px 24px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--gold);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 0;
}
.btn-primary {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger {
    background: #c62828;
    color: var(--white);
    border-color: #c62828;
}
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}
.login-box {
    background: var(--white);
    padding: 50px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
.login-box h1 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 5px;
}
.login-box h1 span { color: var(--gold); font-style: italic; }
.login-box p { color: var(--text-light); margin-bottom: 30px; }
.login-error { color: #c62828; font-size: 0.85rem; margin-bottom: 10px; }

.admin-nav {
    background: var(--dark);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.admin-nav h2 {
    font-size: 1.2rem;
    color: var(--white);
}
.admin-nav h2 span { color: var(--gold); font-style: italic; }
.admin-nav-links { display: flex; gap: 15px; align-items: center; }
.nav-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}
.nav-link:hover { color: var(--white); }
.logout { color: var(--gold); }
.logout:hover { color: var(--gold-light); }

.admin-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}
.admin-sidebar {
    width: 200px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}
.sidebar-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 24px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.sidebar-btn:hover { background: var(--cream); }
.sidebar-btn.active {
    background: var(--cream);
    color: var(--gold-dark);
    border-left-color: var(--gold);
    font-weight: 500;
}

.admin-main {
    flex: 1;
    padding: 30px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.tab-header h2 { font-size: 1.5rem; color: var(--dark); }

.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}
th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
th {
    background: var(--cream);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}
tr:hover td { background: #fcfaf7; }
td img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--cream);
}
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.stock-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
}
.stock-in { background: #e8f5e9; color: #2e7d32; }
.stock-out { background: #fbe9e7; color: #c62828; }

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    position: relative;
    background: var(--white);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
}
.modal-form h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color 0.3s;
    border-radius: 0;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.settings-form { max-width: 800px; }
.settings-section {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}
.settings-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold-dark);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cream);
}

@media (max-width: 768px) {
    .admin-container { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        display: flex;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0;
        overflow-x: auto;
    }
    .sidebar-btn {
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
        padding: 12px 20px;
    }
    .sidebar-btn.active {
        border-left-color: transparent;
        border-bottom-color: var(--gold);
    }
    .admin-main { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .modal-content { padding: 25px; }
}
