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

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --bg-color: #f5f6f8;
    --sidebar-bg: #0b1528;
    --text-dark: #2b3648;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: url('../assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100vh;
    padding: 12px;
    gap: 12px;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #0f172ad9; /* Dark semi-transparent */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    color: #fff;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* removed gradient since background is glass */
}

.brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 5px;
    font-weight: 500;
}

.badge {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.nav-section {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
    padding: 0 20px;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin: 4px 15px;
    border-radius: 8px;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: all 0.2s;
}

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

.nav-item:hover i {
    color: #fff;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.nav-item.active i {
    color: #fff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.topbar {
    background-color: transparent;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
}

.topbar-left h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.topbar-right {
    display: flex;
    gap: 15px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

.view.active {
    display: block;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    position: relative;
}

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

.stat-header h3 {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #f0fdf4; color: #22c55e; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.stat-trend {
    margin-top: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-trend.positive { color: #22c55e; }
.stat-trend.neutral { color: #94a3b8; }
.stat-trend.negative { color: #ef4444; }

/* Generic Layouts */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.view-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.view-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(13, 110, 253, 0.3);
}

/* Forms */
.form-container {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.hidden {
    display: none !important;
}

input[type="text"], input[type="number"], select, textarea {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    background-color: #f8fafc;
    transition: all 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

td {
    font-size: 0.9rem;
    color: var(--text-dark);
}

tbody tr {
    transition: background-color 0.2s;
}

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

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
