/* Modern Design System - Compact Edition */
:root {
    /* Color Palette - Elegant & Professional */
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary-color: #64748b;
    /* Slate */
    --accent-color: #0ea5e9;
    /* Sky Blue */

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Very light slate */
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    /* Text */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Borders & Shadows */
    --border-color: #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);

    /* Spacing - COMPACT */
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --header-height: 56px;
    /* Reduced from 64px */
    --sidebar-width: 240px;
    /* Reduced from 260px */
}

html {
    font-size: 13px;
    /* Reduced base font size for desktop feel */
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
    line-height: 1.4;
    /* Tighter line height */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout Structure */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    /* Reduced padding */
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.125rem;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.nav-link i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    text-align: right;
    line-height: 1.1;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Page Content */
.content-wrapper {
    padding: 1.5rem;
    /* Reduced padding */
    max-width: 1600px;
    /* Wider for desktop feel */
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    /* Reduced padding */
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 0.75rem 1rem;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1rem;
}

/* Compact Tables */
.table-compact th,
.table-compact td {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

/* Mobile Responsive */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}


.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

/* Layout Structure */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    /* Reduced padding */
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.125rem;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.nav-link i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    text-align: right;
    line-height: 1.1;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Page Content */
.content-wrapper {
    padding: 1.5rem;
    /* Reduced padding */
    max-width: 1600px;
    /* Wider for desktop feel */
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    /* Reduced padding */
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 0.75rem 1rem;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1rem;
}

/* Compact Tables */
.table-compact th,
.table-compact td {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

/* Mobile Responsive */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}


.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

/* Custom Scrollbar for desktop feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsive - CRITICAL */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .mobile-toggle {
        display: block !important;
    }

    .content-wrapper {
        padding: 0.75rem !important;
    }
}