/* Admin Panel Variables (Inheriting design principles from style.css) */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --secondary: #0f172a;
    --secondary-light: #1e293b;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --border-color: #e2e8f0;

    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #f8fafc;

    --radius: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    display: flex;
    min-height: 100vh;
}

/* Utilities */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.bg-primary-light {
    background-color: var(--primary-light);
}

.bg-success-light {
    background-color: var(--success-light);
}

.bg-warning-light {
    background-color: var(--warning-light);
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.p-0 {
    padding: 0 !important;
}

.hidden {
    display: none !important;
}

/* Layout */
.admin-layout {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--secondary);
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: var(--secondary-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

.logo strong {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    position: relative;
}

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

.nav-item.active {
    color: white;
    background-color: var(--primary);
    border-left: 4px solid var(--primary-light);
}

.nav-item.site-link {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.badge {
    background-color: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: auto;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.topbar {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
}

.topbar h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 35px;
    height: 35px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.contentArea {
    padding: 2rem;
    flex: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3,
.card-header h4 {
    font-size: 1rem;
    margin: 0;
    color: var(--secondary);
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-details h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.875rem;
}

.table td {
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.status-completed {
    background-color: var(--success-light);
    color: var(--success);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col-half {
    flex: 1 1 calc(50% - 1rem);
}

.col-full {
    flex: 1 1 100%;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.success-text {
    color: var(--success);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

/* =============================================
   LOGIN OVERLAY
   ============================================= */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.25rem;
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

.login-card.shake {
    animation: shake 0.5s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.login-logo i {
    color: var(--primary);
    font-size: 1.6rem;
}

.login-logo strong {
    color: var(--primary);
}

.login-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.75rem;
}

.login-form-group {
    margin-bottom: 1.25rem;
}

.login-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.login-form-group label i {
    margin-right: 0.35rem;
    color: var(--primary);
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.625rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.12);
}

.toggle-pass-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.toggle-pass-btn:hover {
    color: white;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.625rem;
    background: var(--primary);
    letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.25rem;
}

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

.login-btn:active {
    transform: scale(0.98);
}

/* Logout Button in Sidebar */
.logout-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.logout-btn:hover {
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Extra utilities */
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

.login-error.mt-2 {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        left: -260px;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .mobile-menu-btn.d-none-lg {
        display: block;
    }
}