/* ===== ADMIN PAGE STYLES ===== */

.admin-page {
    background: #f4f7f9;
    min-height: 100vh;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary);
}

.login-form button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.login-form button:hover {
    background: var(--primary-dark);
}

.back-to-menu {
    margin-top: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

/* Dashboard Layout */
.admin-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #1a1a2e;
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-logo {
    font-size: 24px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 14px 16px;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* Content Area */
.admin-content {
    padding: 40px;
    max-width: 100%;
    margin: 0;
    width: 100%;
}

.prod-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.product-row td {
    vertical-align: middle;
}

.category-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 800;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary {
    background: #eee;
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* Card Table */
.card-table {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

th {
    background: #f9fafb;
    padding: 16px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid #eee;
}

td {
    padding: 16px;
    border-bottom: 1px solid #f9fafb;
    font-size: 15px;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.settings-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* Modal Mini Overlay Fix */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-mini {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-mini {
    transform: translateY(0);
}

/* ===== OPTIONS BUILDER ADMIN ===== */
.options-admin-section {
    background: #fcfcfc;
    border: 1px dashed #ddd;
    border-radius: 12px;
    padding: 15px;
}

.option-group-admin {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.option-group-admin:last-child {
    margin-bottom: 0;
}

.btn-remove-group {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.option-items-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item-admin {
    display: flex;
    gap: 8px;
    align-items: center;
}

.option-item-admin input {
    font-size: 13px;
    padding: 8px 10px;
}

.btn-remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-ghost-primary {
    background: #eff6ff;
    color: #3b82f6;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-ghost-primary:hover {
    background: #dbeafe;
}

/* Toast for Admin */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.toast.show {
    bottom: 30px;
    opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-wrapper {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        display: none; /* In a real app we'd have a mobile menu */
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}
