/* public/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Modern & Professional */

    /* Primary (Brand) */
    --primary: 225, 70%, 55%;
    /* Indigo #3b82f6 approx */
    --primary-light: 225, 100%, 75%;
    --primary-dark: 225, 70%, 45%;

    /* Neutral / Text */
    --slate-900: 222, 47%, 11%;
    /* Darkest Text #0f172a */
    --slate-800: 215, 28%, 17%;
    /* #1e293b */
    --slate-600: 215, 16%, 47%;
    /* Muted Text #475569 */
    --slate-400: 215, 20%, 65%;
    /* Light Muted #94a3b8 */
    --slate-200: 210, 40%, 96%;
    /* Borders #f1f5f9 */
    --slate-100: 210, 40%, 98%;
    /* Background #f8fafc */

    /* Semantic */
    --danger: 345, 80%, 50%;
    /* #ef4444 */
    --success: 150, 60%, 45%;
    /* #16a34a */
    --warning: 40, 90%, 50%;
    /* #f59e0b */
    --info: 210, 100%, 50%;
    /* #3b82f6 */

    /* Theme Tokens */
    --bg-body: var(--slate-100);
    --bg-surface: 0, 0%, 100%;
    --bg-sidebar: var(--slate-900);

    --text-main: var(--slate-900);
    --text-muted: var(--slate-600);
    --text-light: 214, 32%, 91%;

    --border-color: var(--slate-200);

    /* Shadows - Layered & Soft */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: hsl(var(--bg-body));
    color: hsl(var(--text-main));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Sidebar - Modern Dark */
.sidebar {
    width: 260px;
    background: #0f172a;
    /* Slate 900 Solid */
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    z-index: 50;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    width: calc(100% - 260px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed+.main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* Sidebar Header */
.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo img {
    height: 32px;
    transition: opacity 0.2s;
}

.sidebar.collapsed .logo img {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Sidebar Navigation */
.nav-group {
    padding: 0.25rem 0;
}

.nav-group-label {
    padding: 0.25rem 1.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.sidebar.collapsed .nav-group-label {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.25rem 1.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    height: 34px;
    position: relative;
}

.nav-link:hover {
    color: white;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

/* Active State - Glow */
.nav-link.active {
    color: white;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
    border-left-color: #60a5fa;
    /* Blue-400 */
}

/* Icons */
.nav-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    /* Fixed width for collapse */
    margin-right: 14px;
    opacity: 0.6;
    transition: all 0.2s;
    filter: grayscale(100%) brightness(1.5);
    /* Make emojis/icons uniformish */
}

/* Emojis look better plain sometimes, but icons need specific styles. Assuming mostly emojis or inline SVGs? */
/* The user requested lighter weight icons. */

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
    filter: none;
    transform: scale(1.1);
}

.nav-text {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

/* Typography Overrides */
h1,
h2,
h3,
h4 {
    color: hsl(var(--slate-900));
    letter-spacing: -0.03em;
}

/* Dashboard Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Spans for Bento */
.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.row-span-2 {
    grid-row: span 2;
}

@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .col-span-1,
    .col-span-2,
    .col-span-3 {
        grid-column: span 2;
    }

    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
    }

    .sidebar {
        width: 80px;
    }

    .sidebar .logo img,
    .nav-text,
    .nav-group-label {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 0.75rem;
    }

    .nav-icon {
        margin: 0;
    }

    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .col-span-1,
    .col-span-2,
    .col-span-3,
    .col-span-4 {
        grid-column: span 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .sidebar {
        display: none;
    }

    /* Or mobile menu */
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-xl);
    /* More rounded */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.link-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: #e2e8f0;
}

/* Metric Cards Decoration */
.card-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.link-card:hover .card-shine {
    opacity: 1;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: hsl(var(--slate-900));
    line-height: 1.1;
    margin: 0.5rem 0;
}

.metric-trend {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    color: #16a34a;
}

.trend-down {
    color: #ef4444;
}

.trend-neutral {
    color: #64748b;
}

/* Status Badges - Vibrant */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.725rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-blue {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

.badge-green {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-amber {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-red {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-purple {
    background: #faf5ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.badge-gray {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Table Improvements */
.table-container {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    box-shadow: none;
}

th {
    background: #f8fafc;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    padding: 1rem;
}

td {
    padding: 1rem;
    font-size: 0.9rem;
}

tr:hover td {
    background: #fcfcfc;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    /* Softer inputs */
    padding: 0.75rem;
}

input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Utilities */
.text-muted {
    color: var(--slate-600);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.w-full {
    width: 100%;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
    gap: 0.5rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: hsl(var(--primary-dark));
}

.btn-outline {
    background-color: transparent;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}

.btn-success {
    background-color: var(--success);
    /* Assuming var exists, else hardcode */
    color: white;
}

.btn-success:hover {
    filter: brightness(90%);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.alert {
    border-radius: 8px;
}

/* Modal Animation */
dialog {
    border-radius: 12px;
}