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

:root {
    --primary: #0d47a1;
    --primary-light: #1565c0;
    --secondary: #00acc1;
    --accent: #fbc02d;
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --danger: #c62828;
    --danger-light: #ffebee;
    --warning: #ef6c00;
    --warning-light: #fff3e0;
    --bg-main: #f4f7fe;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar as Dropdown */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 32px;
    top: 80px;
    height: auto;
    padding-bottom: 16px;
    z-index: 100;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 1;
    transform: translateY(0);
}

.sidebar-brand {
    padding: 24px;
    display: none; /* Hide brand inside dropdown since it is in topbar now */
}

.sidebar-menu {
    list-style: none;
    padding: 0 16px;
    margin-top: 16px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-menu a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background-color: var(--bg-card);
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    padding: 8px 16px;
    border-radius: 30px;
    width: 300px;
}

.search-box i {
    color: var(--text-muted);
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-right .icon-btn {
    position: relative;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.topbar-right .icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .info .name {
    font-weight: 600;
    font-size: 14px;
}

.user-profile .info .role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Content Area */
.content {
    padding: 32px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Dashboard Sections */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Banner */
.welcome-banner {
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

.welcome-banner .text-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-banner .text-content p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--text-dark);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Grid Layouts */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Stat Card */
.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

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

.stat-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-blue { background: #e3f2fd; color: #1e88e5; }
.icon-green { background: #e8f5e9; color: #43a047; }
.icon-orange { background: #fff3e0; color: #fb8c00; }
.icon-red { background: #ffebee; color: #e53935; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.stat-footer.up { color: var(--success); }
.stat-footer.down { color: var(--danger); }

/* Charts & Tables Section */
.grid-2-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.panel {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

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

.panel-title {
    font-size: 16px;
    font-weight: 700;
}

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

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

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    background-color: var(--bg-main);
    font-weight: 600;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dark);
}

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

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: #e3f2fd; color: #1e88e5; }

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--border);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
}

/* WDIGI Specific Customization */
.header-wdigi {
    background: #001f3f; /* Deep navy */
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: -24px -24px 24px -24px;
}

.wdigi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.wdigi-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    overflow: hidden;
}

.wdigi-card-header {
    background: #001f3f;
    color: white;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wdigi-card-body {
    padding: 16px;
    background: white;
}

.wdigi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.wdigi-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.target-nol-card {
    border-color: var(--danger);
}
.target-nol-card .wdigi-card-header {
    background: var(--danger);
}
.target-nol-card .wdigi-value {
    color: var(--danger);
}
