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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --dark: #0f172a;
    --light: #f8fafc;
    --sidebar-width: 260px;
    --glass: rgba(255, 255, 255, 0.7);
}

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

body {
    font-family: 'Inter', 'Prompt', sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar::-webkit-scrollbar {
    display: none;
}
.sidebar .logo-area, .sidebar .sidebar-footer {
    padding: 0 1.5rem;
    transition: all 0.3s ease;
}
/* Collapsed: sidebar-brand switches to vertical stack */
.sidebar.collapsed .sidebar-brand {
    flex-direction: column;
    padding: 0.8rem 0;
    gap: 0.5rem;
    align-items: center;
}
.sidebar.collapsed .logo-container {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 10px;
    flex: none;
}
.sidebar.collapsed .sidebar-toggle-btn {
    margin-left: 0 !important;
    width: 44px;
    height: 34px;
}
.sidebar.collapsed .logo-full {
    display: none !important;
}
.sidebar.collapsed .logo-mini {
    display: block !important;
}
.sidebar.collapsed .logo-area h2, 
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-item-header,
.sidebar.collapsed .sidebar-footer span,
.sidebar.collapsed .sidebar-footer div:last-child,
.sidebar.collapsed .nav-menu span {
    display: none !important;
}
.sidebar.collapsed .nav-link {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.5rem;
    padding: 0;
    justify-content: center;
}
.sidebar.collapsed .nav-link i {
    font-size: 1.3rem;
    margin: 0;
}
.sidebar.collapsed {
    overflow-x: hidden;
}
.sidebar.collapsed .sidebar-footer {
    padding: 1.5rem 0;
    justify-content: center;
}
.sidebar.collapsed .sidebar-footer .user-avatar-container {
    margin: 0 !important;
}
.sidebar .nav-menu {
    padding: 0 0.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #94a3b8;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem; /* Increase side padding */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
}
.main-content.sidebar-collapsed {
    margin-left: 80px !important;
    width: calc(100% - 80px) !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title p {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}


.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

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

/* Chart & Table Areas */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Table Style */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.data-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-hot { background: #fee2e2; color: #ef4444; }
.status-warm { background: #fef3c7; color: #f59e0b; }
.status-cold { background: #e0f2fe; color: #0ea5e9; }

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

.stat-card, .card {
    animation: fadeIn 0.5s ease forwards;
}

/* Micro-interactions */
/* Enhanced Form Controls */
.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #fff;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: none;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
    margin-bottom: 1.5rem;
}

/* Modal Improvements */
.modal-content {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Tooltip Utility */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
}
.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #0f172a;
    color: #ffffff !important;
    text-align: left;
    border-radius: 12px;
    padding: 1.2rem;
    position: absolute;
    z-index: 9999;
    bottom: 160%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.85rem;
    line-height: 1.6;
    font-weight: 400;
    text-transform: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    letter-spacing: normal;
    border: 1px solid rgba(255,255,255,0.1);
}
.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    bottom: 140%;
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}
