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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #e5e7eb;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    margin-bottom: 24px;
    text-align: center;
    color: #ec4899;
}

.login-hint {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #666;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #0d1117;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    display: flex;
    flex-direction: column;
}

.admin-sidebar::-webkit-scrollbar { width: 3px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand-icon i {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.sidebar-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.sidebar-theme-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-theme-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #f1f5f9;
}

.sidebar-theme-btn i {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Nav */
.sidebar-nav {
    padding: 10px 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-section {
    margin: 0;
}

.section-title {
    padding: 14px 16px 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(148, 163, 184, 0.45);
}

/* Nav Items */
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 16px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.18s ease;
    position: relative;
    font-weight: 500;
    font-size: 13.5px;
    margin: 1px 0;
}

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

.sidebar-nav .nav-item.active {
    background: #c0392b;
    color: #ffffff;
}

.sidebar-nav .nav-item.active .nav-label {
    color: #ffffff;
}

/* Colored Nav Icons */
.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.nav-icon i {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.nav-icon--indigo  { background: rgba(99, 102, 241, 0.2);  color: #818cf8; }
.nav-icon--red     { background: rgba(239, 68,  68,  0.2);  color: #f87171; }
.nav-icon--amber   { background: rgba(245, 158, 11,  0.2);  color: #fbbf24; }
.nav-icon--green   { background: rgba(34,  197, 94,  0.2);  color: #4ade80; }
.nav-icon--sky     { background: rgba(14,  165, 233, 0.2);  color: #38bdf8; }
.nav-icon--violet  { background: rgba(139, 92,  246, 0.2);  color: #a78bfa; }
.nav-icon--teal    { background: rgba(20,  184, 166, 0.2);  color: #2dd4bf; }
.nav-icon--pink    { background: rgba(236, 72,  153, 0.2);  color: #f472b6; }
.nav-icon--emerald { background: rgba(16,  185, 129, 0.2);  color: #34d399; }
.nav-icon--orange  { background: rgba(249, 115, 22,  0.2);  color: #fb923c; }
.nav-icon--cyan    { background: rgba(6,   182, 212, 0.2);  color: #22d3ee; }
.nav-icon--rose    { background: rgba(244, 63,  94,  0.2);  color: #fb7185; }
.nav-icon--slate   { background: rgba(100, 116, 139, 0.2);  color: #94a3b8; }

.sidebar-nav .nav-item.active .nav-icon {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: inherit;
}

/* Sidebar Bottom (View Site + Logout) */
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 8px 0;
}

.nav-item--viewsite:hover {
    background: rgba(20, 184, 166, 0.08) !important;
    color: #2dd4bf !important;
}

.nav-item--logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

/* Dropdown Menu Styles */
.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 16px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    user-select: none;
    font-weight: 500;
    font-size: 13.5px;
    margin: 1px 0;
}

.dropdown-toggle:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.dropdown-toggle.active {
    color: #e2e8f0;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}

.dropdown-arrow i {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.dropdown-content {
    display: none;
    margin-top: 1px;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content .nav-item {
    padding: 8px 16px 8px 24px;
    font-size: 13px;
}

.dropdown-content .nav-item .nav-icon {
    width: 24px;
    height: 24px;
}

.dropdown-content .nav-item .nav-icon i {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.admin-content {
    margin-left: 220px;
    flex: 1;
    background: #0a0a0a;
}

.admin-header {
    background: #0a0a0a;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    border-bottom: 1px solid #1f1f1f;
}

.admin-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.admin-header-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-search {
    position: relative;
}

.admin-search input {
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    padding: 10px 16px 10px 40px;
    color: #fff;
    font-size: 14px;
    width: 200px;
    transition: all 0.2s;
}

.admin-search input:focus {
    outline: none;
    border-color: #ec4899;
    width: 280px;
}

.admin-search input::placeholder {
    color: #6b7280;
}

.admin-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #10b981;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.admin-main {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="file"] {
    padding: 8px 0;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.form-row {
    display: grid;
    gap: 16px;
}

.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }

.form-row {
    grid-template-columns: repeat(12, 1fr);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #ec4899;
}

.toggle-password:focus {
    outline: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-primary {
    background: #ec4899;
    color: white;
}

.btn-primary:hover {
    background: #be185d;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 4px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tables - consolidated with later definitions */

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    border-bottom: 2px solid #1f1f1f;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #1f1f1f;
    color: #e2e8f0;
}

.data-table tbody tr:hover {
    background: #141414;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}


/* Badges */

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 28px;
}

/* Admin Form */
.admin-form {
    background: #141414;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-form h3 {
    margin: 24px 0 16px 0;
    padding-top: 16px;
    border-top: 1px solid #1f1f1f;
    color: #fff;
}

.admin-form h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

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

.grid-col-8 {
    grid-column: span 8;
}

.grid-col-4 {
    grid-column: span 4;
}

.card {
    background: #141414;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
}

.card h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

/* Form inputs in dark theme */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    background: #141414;
    color: #e5e7eb;
    border: 1px solid #1f1f1f;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #6b7280;
}

.form-group label {
    color: #9ca3af;
}

.card {
    background: #141414;
    border: 1px solid #1f1f1f;
}

.card h3 {
    color: #e5e7eb;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #111;
    border: 1px solid #1f1f1f;
    padding: 16px 18px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s ease;
    min-height: 0;
}

.stat-card:hover {
    border-color: #2a2a2a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

.stat-card-title {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stat-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: transparent;
}

.stat-card-icon.purple { color: #a78bfa; }
.stat-card-icon.pink { color: #f472b6; }
.stat-card-icon.blue { color: #60a5fa; }
.stat-card-icon.green { color: #34d399; }
.stat-card-icon.orange { color: #fbbf24; }
.stat-card-icon.cyan { color: #22d3ee; }
.stat-card-icon.red { color: #f87171; }
.stat-card-icon.indigo { color: #818cf8; }

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-card-subtitle {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-card-change {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.stat-card-change.positive {
    color: #10b981;
}

.stat-card-change.positive::before {
    content: "↗";
    font-size: 10px;
}

.stat-card-change.negative {
    color: #ef4444;
}

.stat-card-change.negative::before {
    content: "↘";
    font-size: 10px;
}

.stat-card-change span {
    color: #6b7280;
}

/* Legacy gradient cards - keep for compatibility */
.gradient-purple {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.gradient-pink {
    background: linear-gradient(135deg, #ff6b9d 0%, #c94b82 100%);
}

.gradient-cyan {
    background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.gradient-indigo {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.gradient-rose {
    background: linear-gradient(135deg, #f687b3 0%, #ed64a6 100%);
}

.stat-icon-bg {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 80px;
    opacity: 0.15;
    line-height: 1;
}

.stat-details {
    position: relative;
    z-index: 2;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.stat-details h3 {
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
}

.stat-change {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* Chart Sections */
.chart-section {
    background: #141414;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #1f1f1f;
}

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

.chart-header h2 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.chart-subtitle {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 6px;
}

.chart-filters {
    display: flex;
    gap: 4px;
    background: #111;
    padding: 3px;
    border-radius: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 10px;
    background: #141414;
    border: 1px solid #1f1f1f;
    color: #9ca3af;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #1f1f1f;
    border-color: #2a2a2a;
    color: #fff;
}

.filter-btn.active {
    background: #ec4899;
    border-color: #ec4899;
    color: white;
}

.chart-container {
    position: relative;
    height: 240px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

/* Dashboard Section */
.dashboard-section {
    background: #141414;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #1f1f1f;
}

.dashboard-section h2 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* Tables */
.table-responsive {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
}

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

.data-table thead {
    background: #141414;
}

.data-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 2px solid #1f1f1f;
}

.data-table tbody tr {
    border-bottom: 1px solid #1f1f1f;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #141414;
}

.data-table tbody td {
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 13px;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.btn-small {
    background: #ec4899;
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #be185d;
    transform: translateY(-2px);
}

/* Blog Admin Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1f1f1f;
}

.page-header h1 {
    color: #fff;
    font-size: 28px;
    margin: 0;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #141414;
    padding: 8px;
    border-radius: 12px;
}

.filter-tab {
    padding: 10px 20px;
    background: transparent;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-tab:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #fff;
}

.filter-tab.active {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
}

.table-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.table-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f1f1f;
    border-radius: 8px;
    font-size: 24px;
}

.text-muted {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-published {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.status-draft {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #141414;
    border-radius: 16px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: #94a3b8;
    margin-bottom: 24px;
}

.featured-image-preview {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.featured-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.post-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #334155;
}

.post-meta small {
    color: #94a3b8;
    line-height: 1.8;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.page-link {
    padding: 8px 16px;
    background: #141414;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.page-link:hover {
    background: rgba(236, 72, 153, 0.2);
    color: #fff;
}

.page-link.active {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.modal-content form {
    padding: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.close:hover,
.close:focus {
    opacity: 0.7;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 220px;
    }
    
    .admin-content {
        margin-left: 220px;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-col-8, .grid-col-4 {
        grid-column: span 1;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        min-height: 0;
        padding: 12px 14px;
    }
    
    .stat-details h3 {
        font-size: 32px;
    }
    
    .stat-icon-bg {
        font-size: 60px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Light Mode Toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: #141414;
    border: 1px solid #1f1f1f;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: #1f1f1f;
    border-color: #ec4899;
}

/* Light Mode Styles */
html.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #141414;
    --text-secondary: #64748b;
    --border: #e2e8f0;
}

html.light-mode body {
    background: #f8f9fa;
    color: #141414;
}

html.light-mode .admin-sidebar {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 50%, #f0f4ff 100%);
    color: #141414;
    border-right: 1px solid #c7d2fe;
    box-shadow: 4px 0 12px rgba(99, 102, 241, 0.1);
}

html.light-mode .sidebar-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    color: white;
}

html.light-mode .sidebar-header h2 {
    color: white;
}

html.light-mode .sidebar-header small {
    color: rgba(255, 255, 255, 0.7);
}

html.light-mode .section-title {
    color: #4f46e5;
}

html.light-mode .sidebar-nav .nav-item {
    color: #57534e;
}

html.light-mode .sidebar-nav .nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #3730a3;
}

html.light-mode .sidebar-nav .nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #3730a3;
}

html.light-mode .sidebar-nav .nav-item.active::before {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}

html.light-mode .dropdown-toggle {
    color: #57534e;
}

html.light-mode .dropdown-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #3730a3;
}

html.light-mode .dropdown-toggle.active {
    color: #4f46e5;
}

html.light-mode .admin-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.light-mode .admin-header h1 {
    color: #141414;
}

html.light-mode .theme-toggle {
    background: #f0f4f8;
    border-color: #cbd5e1;
    color: #141414;
}

html.light-mode .theme-toggle:hover {
    background: rgba(236, 72, 153, 0.15);
    border-color: #ec4899;
}

html.light-mode .form-control,
html.light-mode textarea,
html.light-mode select {
    background: white;
    color: #141414;
    border-color: #e2e8f0;
}

html.light-mode .btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

html.light-mode .content-list,
html.light-mode .form-section,
html.light-mode .empty-state {
    background: white;
    border: 1px solid #e2e8f0;
}

html.light-mode .stat-card:not([class*="gradient-"]) {
    background: white;
    border: 1px solid #e2e8f0;
}

html.light-mode .stat-card.gradient-purple,
html.light-mode .stat-card.gradient-cyan,
html.light-mode .stat-card.gradient-green,
html.light-mode .stat-card.gradient-coral,
html.light-mode .stat-card.gradient-pink {
    border: none;
}

html.light-mode .tab {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #141414;
}

html.light-mode .tab.active {
    background: white;
    border-color: #ec4899;
    color: #ec4899;
}

html.light-mode .table,
html.light-mode table {
    background: white;
    color: #141414;
}

html.light-mode th {
    background: #f3f4f6;
    color: #141414;
    border-color: #e5e7eb;
}

html.light-mode td {
    border-color: #e5e7eb;
}

html.light-mode .alert {
    border-color: #e5e7eb;
}

/* ===== Ad Manager Styles (Dark Mode Enabled) ===== */
html {
    --ads-text: #1f2937;
    --ads-text-light: #6b7280;
    --ads-border: #e5e7eb;
    --ads-card-bg: #f3f4f6;
    --ads-input-bg: #f9fafb;
    --ads-input-border: #d1d5db;
}

html.dark-mode {
    --ads-text: #e5e7eb;
    --ads-text-light: #9ca3af;
    --ads-border: #ec4899;
    --ads-card-bg: #141414;
    --ads-input-bg: #111;
    --ads-input-border: #ec4899;
}

.ads-cards-container {
    padding: 0 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.ads-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .ads-cards-grid {
        grid-template-columns: 1fr;
    }
}

.ad-position-card {
    background: var(--ads-card-bg);
    border: 2.5px solid var(--ads-border);
    border-radius: 14px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.1);
}

html.dark-mode .ad-position-card {
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.2), inset 0 0 0 1px rgba(236, 72, 153, 0.3);
}

.ad-position-card:hover {
    border-color: #ec4899;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.25);
}

html.dark-mode .ad-position-card:hover {
    box-shadow: 0 0 24px rgba(190, 24, 93, 0.4), inset 0 0 0 1px rgba(190, 24, 93, 0.5);
    border-color: #ec4899;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ads-border);
}

.card-title {
    display: flex;
    gap: 12px;
    flex: 1;
}

.card-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
}

.card-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ads-text);
    margin: 0 0 4px 0;
}

.card-placement {
    font-size: 12px;
    color: var(--ads-text-light);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #ec4899;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.ad-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--ads-text);
}

.form-textarea {
    padding: 12px 14px;
    border: 2px solid var(--ads-input-border);
    border-radius: 8px;
    background: var(--ads-input-bg);
    color: var(--ads-text);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    background: var(--ads-input-bg);
}

.form-hint {
    font-size: 12px;
    color: var(--ads-text-light);
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--ads-border);
    margin-top: auto;
}

.enable-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ads-text);
    cursor: pointer;
    font-weight: 500;
}

.enable-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ec4899;
}

.btn-save-ad {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-save-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}
/* Force bright text in dark mode for ad cards */
html.dark-mode .ad-position-card .card-title h3,
html.dark-mode .ad-position-card .form-label,
html.dark-mode .ad-position-card .enable-checkbox {
    color: #ffffff !important;
}

html.dark-mode .ad-position-card .card-placement,
html.dark-mode .ad-position-card .form-hint {
    color: #cbd5e1 !important;
}

html.dark-mode .ad-position-card .form-textarea {
    color: #e5e7eb !important;
    background: #111 !important;
    border-color: #ec4899 !important;
}

html.dark-mode .ad-position-card .form-textarea::placeholder {
    color: #64748b !important;
}

/* Data Management Section */
.data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.data-action-card {
    background: linear-gradient(135deg, #141414 0%, #0a0a0a 100%);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.data-action-card:hover {
    border-color: rgba(236, 72, 153, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.2);
}

.data-action-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.data-action-card h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.data-action-card p {
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}

.btn-block {
    width: 100%;
}

/* Dark theme consistency */
html.dark-mode .card {
    background: #141414;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

html.dark-mode .form-control,
html.dark-mode .form-control:focus,
html.dark-mode .form-group input[type="text"],
html.dark-mode .form-group input[type="email"],
html.dark-mode .form-group input[type="password"],
html.dark-mode .form-group input[type="url"],
html.dark-mode .form-group input[type="number"],
html.dark-mode .form-group select,
html.dark-mode .form-group textarea {
    background: #0a0a0a;
    color: #f1f5f9;
    border-color: rgba(236, 72, 153, 0.3);
}

html.dark-mode .form-control::placeholder,
html.dark-mode .form-group input::placeholder,
html.dark-mode .form-group textarea::placeholder {
    color: #64748b;
}

html.dark-mode label {
    color: #cbd5e1;
}

html.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

html.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}
