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

:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --secondary: #64748b;
    --accent: #14b8a6;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #38bdf8;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 0.925rem;
    overflow-x: hidden;
}

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

/* Sidebar Styles */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-brand i {
    color: #38bdf8;
    font-size: 1.3rem;
}

.sidebar-brand-logo {
    max-height: 38px;
    max-width: 175px;
    object-fit: contain;
    display: block;
}

.sidebar-menu {
    padding: 0.35rem 0;
    flex: 1;
    overflow-y: auto;
}

.menu-category {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.45rem 1.25rem 0.15rem;
    font-weight: 700;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.38rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.86rem;
    line-height: 1.35;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-link-custom:hover {
    color: #f8fafc;
    background-color: var(--sidebar-active-bg);
}

.nav-link-custom.active {
    color: var(--sidebar-active-text);
    background-color: var(--sidebar-active-bg);
    border-left-color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-link-custom i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.3s ease;
}

/* Navbar Header */
.app-navbar {
    height: 65px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-subtle);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-main);
    cursor: pointer;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

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

/* Content Container */
.content-body {
    padding: 1.75rem;
    flex: 1;
}

/* Cards & Components */
.card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.card-custom-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-custom-body {
    padding: 1.4rem;
}

/* Stat KPI Cards */
.stat-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-subtle);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.primary { background-color: #e0f2fe; color: #0284c7; }
.stat-icon.warning { background-color: #fef3c7; color: #d97706; }
.stat-icon.success { background-color: #dcfce7; color: #16a34a; }
.stat-icon.danger { background-color: #fee2e2; color: #dc2626; }
.stat-icon.info { background-color: #ccfbf1; color: #0d9488; }
.stat-icon.indigo { background-color: #e0e7ff; color: #4f46e5; }

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.825rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Activity Timeline Component */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 9px;
    width: 2px;
    background-color: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-icon {
    position: absolute;
    left: -2rem;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-content {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.timeline-title {
    font-weight: 700;
    color: var(--text-main);
}

/* Table Styles */
.table-custom {
    width: 100%;
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: #475569;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
    padding: 0.85rem 1rem;
}

.table-custom td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .navbar-toggle {
        display: block;
    }
}
