@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.98);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 30%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* Utility */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }

/* Login */
.login-wrapper {
    display: flex; justify-content: center; align-items: center; height: 100vh; padding: 20px;
}
.login-box {
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 40px; border-radius: 20px; width: 100%; max-width: 400px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    text-align: center;
}
.login-box h2 { font-size: 24px; font-weight: 700; margin-bottom: 30px; letter-spacing: -0.5px; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
    width: 100%; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: 10px; font-size: 15px; transition: all 0.3s;
}
.form-control:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); background: white; }

.btn {
    width: 100%; padding: 14px; background: linear-gradient(135deg, var(--accent), #4f46e5); color: white;
    border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59,130,246,0.25);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59,130,246,0.35); }

.alert { padding: 16px; border-radius: 10px; margin-bottom: 24px; text-align: left; font-weight: 500; font-size: 13px; }
.alert-error, .alert.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.alert-success, .alert { background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--success); }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 280px; background: var(--sidebar-bg); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; transition: all 0.3s ease-in-out; position: fixed; height: 100vh; z-index: 100;
}
.logo { padding: 30px; font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px; }
.logo i { color: var(--accent); font-size: 28px; filter: drop-shadow(0 2px 4px rgba(59,130,246,0.2)); }

.nav-header { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.5px; margin: 20px 0 5px 20px; }
.nav-link.sub-link { font-size: 13px; font-weight: 500; padding: 10px 18px 10px 25px; }
.nav-link.sub-link i { font-size: 15px; width: 22px; opacity: 0.8; }


.nav-menu { padding: 0 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; margin-top: 10px; }
.nav-link {
    padding: 14px 18px; color: var(--text-secondary); text-decoration: none; border-radius: 10px;
    display: flex; align-items: center; gap: 12px; font-weight: 600; transition: all 0.3s; font-size: 14px;
}
.nav-link i { font-size: 18px; width: 24px; text-align: center; }
.nav-link:hover { background: #f1f5f9; color: var(--text-primary); transform: translateX(5px); }
.nav-link.active { background: #eff6ff; color: var(--accent); border: 1px solid #bfdbfe; box-shadow: inset 4px 0 0 var(--accent); }
.nav-link.logout { margin-top: auto; margin-bottom: 30px; color: var(--danger); }
.nav-link.logout:hover { background: #fef2f2; transform: translateX(0); }

.main-content { margin-left: 280px; flex: 1; padding: 40px; display: flex; flex-direction: column; gap: 30px; width: calc(100% - 280px); transition: all 0.3s ease-in-out; }

/* Top Header */
.top-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.welcome-text h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.welcome-text p { color: var(--text-secondary); margin-top: 5px; font-size: 14px; }
.user-profile { display: flex; align-items: center; gap: 15px; background: white; padding: 8px 18px 8px 8px; border-radius: 30px; border: 1px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #4f46e5); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; box-shadow: 0 4px 10px rgba(59,130,246,0.3); }

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.stat-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 24px; border-radius: 16px; display: flex; align-items: center; gap: 20px; transition: transform 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08); }
.stat-icon { width: 60px; height: 60px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-info h3 { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; font-weight: 700; }
.stat-info .value { font-size: 20px; font-weight: 800; color: var(--text-primary); }

/* Content Grid */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.panel {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 30px; display: flex; flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.panel-header h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }

/* Status Cards (Admin.php backward compatibility) */
.status-card { background: var(--card-bg); border: 1px solid var(--border-color); padding: 24px; border-radius: 16px; margin-bottom: 30px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.status-card h3 { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.status-card .title { font-size: 18px; font-weight: 600; color: var(--success); }
.status-card .time { color: var(--text-secondary); font-size: 13px; }

/* Settings Form Grid */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-panel { background: #f8fafc; border: 1px solid var(--border-color); padding: 25px; border-radius: 16px; }
.settings-panel h3 { margin-bottom: 20px; font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid #cbd5e1; display: flex; align-items: center; gap:8px; color:var(--text-primary); font-weight: 700; }
.full-width { grid-column: span 2; }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }

/* Feed */
.news-feed { display: flex; flex-direction: column; gap: 15px; }
.news-item { background: white; padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); border-left: 4px solid var(--accent); transition: all 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.news-item:hover { box-shadow: 0 6px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.news-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; line-height: 1.5; color: var(--text-primary); }
.news-meta { display: flex; gap: 15px; color: var(--text-secondary); font-size: 12px; margin-bottom: 10px; font-weight: 500; }
.news-link a { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.news-link a:hover { text-decoration: underline; color: var(--accent-hover); }

/* Mobile Trigger */
.mobile-trigger { display: none; background: white; border: 1px solid var(--border-color); color: var(--text-primary); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; font-size: 18px; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.mobile-trigger:hover { background: #f1f5f9; }
.header-left { display: flex; align-items: center; gap: 20px; }

/* Inline color fix */
span[style*="color:white"] { color: var(--text-primary) !important; font-weight: 600 !important; }

/* RESPONSIVE QUERIES */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
}

@media (max-width: 768px) {
    .mobile-trigger { display: flex; }
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: 20px 0 50px rgba(0,0,0,0.1); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 25px 20px; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 20px; padding-bottom: 15px; }
    .welcome-text { display: flex; justify-content: space-between; width: 100%; align-items: center; }
    .welcome-text h1, .header h1 { font-size: 22px; line-height: 1.2; }
    .header p { display: none; }
    .user-profile { width: 100%; justify-content: center; }
    body { background-image: none; } 
}

@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-box { padding: 30px 20px; border-radius: 12px; }
    .news-meta { flex-direction: column; gap: 5px; }
}
