/* Admin Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #c1a875;
    --primary-dark: #a8905e;
    --bg-dark: #222;
    --text-light: #fff;
    --text-dark: #333;
    --danger: #dc3545;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.admin-logo {
    max-width: 150px;
    max-height: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-nav a {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 500;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--primary);
    color: #222;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 2rem;
    color: #222;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: #222;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background-color: #ccc;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-edit {
    background-color: #ffc107;
    color: #222;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table img {
    max-width: 80px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.actions-cell {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-footer {
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Login Overlay */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* --- Responsive Admin --- */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .sidebar-header {
        padding: 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
    }

    .sidebar-nav a {
        padding: 15px 20px;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 20px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
        text-align: right !important;
    }

    .data-table td:not(:first-child):not(.actions-cell)::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        margin-right: 15px;
        color: #666;
    }

    .data-table td.actions-cell {
        justify-content: center;
        background: #fcfcfc;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    form {
        padding: 15px;
    }
}