/* ==========================================
   CyberWing Admin Panel Styles
   ========================================== */

:root {
    --admin-orange: #E67E22;
    --admin-green: #628141;
    --admin-light: #8BAE66;
    --admin-beige: #EBD5AB;
    --admin-dark: #1a2010;
    --sidebar-w: 260px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f4f6f0;
    color: #2d3a1e;
    overflow-x: hidden;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--admin-dark) 0%, #253018 50%, var(--admin-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    margin: 0 auto 12px;
}

.login-logo h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--admin-dark);
}

.login-logo p {
    font-size: 0.85rem;
    color: #8a9870;
    margin-top: 4px;
}

.login-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.login-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3d4e2a;
}

.login-group input {
    padding: 12px 16px;
    border: 1.5px solid rgba(98, 129, 65, 0.3);
    border-radius: 10px;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s;
}

.login-group input:focus {
    border-color: var(--admin-orange);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.12);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.login-error {
    background: #fff3f3;
    border: 1px solid #fca5a5;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.84rem;
    margin-top: 12px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ---- Admin Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(160deg, var(--admin-dark) 0%, #253018 60%, #2d3a20 100%);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 200;
    overflow-y: auto;
}

.admin-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(139, 174, 102, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.admin-logo-text strong {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: white;
}

.admin-logo-text span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    padding: 16px 10px 8px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 2px;
    text-decoration: none;
}

.sidebar-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--admin-light);
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.sidebar-nav-item.active {
    background: rgba(230, 126, 34, 0.18);
    color: var(--admin-orange);
    border-left: 3px solid var(--admin-orange);
}

.sidebar-nav-item.active i {
    color: var(--admin-orange);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(139, 174, 102, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info strong {
    display: block;
    font-size: 0.82rem;
    color: white;
}

.user-info span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(230, 126, 34, 0.12);
    border: 1px solid rgba(230, 126, 34, 0.25);
    color: var(--admin-orange);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.logout-btn:hover {
    background: rgba(230, 126, 34, 0.22);
}

/* ---- Admin Main ---- */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    background: white;
    border-bottom: 1px solid rgba(98, 129, 65, 0.12);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.topbar-title h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a2010;
}

.topbar-title p {
    font-size: 0.78rem;
    color: #8a9870;
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-site-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--admin-green), #507035);
    color: white;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s;
}

.view-site-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(98, 129, 65, 0.35);
}

.save-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}

.save-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.admin-content {
    flex: 1;
    padding: 28px;
}

/* ---- stat cards ---- */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(98, 129, 65, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.asc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.asc-icon.orange {
    background: rgba(230, 126, 34, 0.12);
    color: var(--admin-orange);
}

.asc-icon.green {
    background: rgba(98, 129, 65, 0.12);
    color: var(--admin-green);
}

.asc-icon.light {
    background: rgba(139, 174, 102, 0.15);
    color: var(--admin-light);
}

.asc-icon.beige {
    background: rgba(235, 213, 171, 0.5);
    color: #8a6520;
}

.asc-num {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #1a2010;
}

.asc-label {
    font-size: 0.78rem;
    color: #8a9870;
}

/* ---- section cards ---- */
.panel-card {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(98, 129, 65, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

.panel-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(98, 129, 65, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-card-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a2010;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-card-header h3 i {
    color: var(--admin-orange);
}

.panel-card-body {
    padding: 24px;
}

/* Page Selector */
.page-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8faf4;
    border: 1.5px solid rgba(98, 129, 65, 0.15);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3d4e2a;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
}

.page-btn i {
    color: var(--admin-orange);
    width: 16px;
    text-align: center;
}

.page-btn:hover,
.page-btn.active {
    background: rgba(230, 126, 34, 0.08);
    border-color: var(--admin-orange);
    color: var(--admin-orange);
    transform: translateY(-2px);
}

/* Content Editor */
.editor-section {
    margin-bottom: 24px;
}

.editor-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3d4e2a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-label i {
    color: var(--admin-orange);
}

.editor-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(98, 129, 65, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1a2010;
    background: #fafaf7;
    outline: none;
    transition: all 0.18s;
    font-family: 'Inter', sans-serif;
}

.editor-input:focus {
    border-color: var(--admin-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.editor-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 14px;
    border: 1.5px solid rgba(98, 129, 65, 0.2);
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #1a2010;
    background: #fafaf7;
    outline: none;
    resize: vertical;
    transition: all 0.18s;
    font-family: 'Inter', sans-serif;
}

.editor-textarea:focus {
    border-color: var(--admin-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

/* Image Manager */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.image-item {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(98, 129, 65, 0.12);
    background: #f8faf4;
}

.image-preview {
    height: 140px;
    object-fit: cover;
    width: 100%;
    background: linear-gradient(135deg, #e8f0e0, #d4e4c0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #8a9870;
    font-size: 0.82rem;
}

.image-preview-placeholder i {
    font-size: 2rem;
}

.image-info {
    padding: 10px 12px;
}

.image-info p {
    font-size: 0.78rem;
    font-weight: 600;
    color: #3d4e2a;
    margin-bottom: 8px;
}

.image-upload-btn {
    width: 100%;
    padding: 7px;
    background: linear-gradient(135deg, var(--admin-orange), #c96a10);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.image-upload-btn:hover {
    opacity: 0.9;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--admin-dark);
    color: white;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success i {
    color: #86efac;
}

.toast.error i {
    color: #fca5a5;
}

/* Tab system */
.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f0f4ea;
    border-radius: 10px;
    margin-bottom: 24px;
}

.admin-tab {
    flex: 1;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #6b7a55;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    border: none;
    background: none;
}

.admin-tab.active {
    background: white;
    color: var(--admin-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Inline edit mode toggle */
.inline-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(98, 129, 65, 0.2);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.25s;
}

.toggle-track:before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-track {
    background: var(--admin-orange);
}

.toggle-switch input:checked+.toggle-track:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #3d4e2a;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 300;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #mobile-toggle {
        display: flex !important;
    }

    .topbar-actions {
        gap: 6px;
    }

    .admin-content {
        padding: 16px;
    }

    .panel-card-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .admin-stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-title h1 {
        font-size: 1rem;
    }
}