/**
 * Elixir Enviro ERP - Design 3: Modern Minimal Theme
 * Beige/Cream/Sand color palette with Rust accents
 */

/* ========================================
   CSS VARIABLES
======================================== */
:root {
    /* Sand/Beige Colors */
    --sand-50: #FEFDFB;
    --sand-100: #FAF8F5;
    --sand-200: #F2EDE5;
    --sand-300: #E5DDD0;
    --sand-400: #D1C4B0;
    --sand-500: #A99D8A;
    
    /* Stone/Brown Colors */
    --stone-600: #7D7465;
    --stone-700: #5C554A;
    --stone-800: #3D3832;
    --stone-900: #252220;
    
    /* Accent Colors */
    --accent-rust: #B5684B;
    --accent-rust-light: #D08B6F;
    --accent-moss: #6B8E6B;
    --accent-moss-light: #8BB58B;
    --accent-slate: #6B7D8E;
    --accent-slate-light: #8BA1B5;
    --accent-amber: #C9A84E;
    --accent-amber-light: #D9C06B;
    --accent-rose: #B56B7D;
    --accent-rose-light: #D08B9F;
    
    /* Base Colors */
    --white: #FFFFFF;
    --black: #000000;
    
    /* Semantic Colors */
    --primary: var(--accent-rust);
    --primary-light: var(--accent-rust-light);
    --success: var(--accent-moss);
    --success-light: var(--accent-moss-light);
    --warning: var(--accent-amber);
    --warning-light: var(--accent-amber-light);
    --danger: var(--accent-rose);
    --danger-light: var(--accent-rose-light);
    --info: var(--accent-slate);
    --info-light: var(--accent-slate-light);
    
    /* Layout */
    --sidebar-width: clamp(130px, 11vw, 165px);
    --sidebar-expanded: 220px;
    --header-height: 0px;
    --border-radius: 10px;
    --border-radius-lg: 14px;
    --border-radius-xl: 18px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(61, 56, 50, 0.04);
    --shadow-md: 0 4px 16px rgba(61, 56, 50, 0.06);
    --shadow-lg: 0 8px 32px rgba(61, 56, 50, 0.08);
    --shadow-xl: 0 16px 48px rgba(61, 56, 50, 0.12);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========================================
   RESET & BASE
======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 12.8px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--sand-100) 0%, var(--sand-200) 100%);
    color: var(--stone-800);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-rust);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-rust-light);
}

img {
    max-width: 100%;
    height: auto;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 16px 20px;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: calc(100vw - var(--sidebar-width));
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        padding-bottom: 80px;
    }
}

/* ========================================
   COMPACT SIDEBAR - Claude Style
======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--sand-200);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px 8px;
    text-decoration: none;
    flex-shrink: 0;
    border-bottom: 1px solid var(--sand-100);
    margin-bottom: 4px;
}

.sidebar-logo:hover {
    color: var(--white);
}

.sidebar-logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    color: var(--white);
    box-shadow: 0 2px 6px rgba(181, 104, 75, 0.25);
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--stone-800);
    letter-spacing: -0.2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sand-200);
    border-radius: 3px;
}

.nav-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 16px;
    color: var(--stone-500);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-size: 11px;
    font-weight: 450;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
    flex-shrink: 0;
}

.nav-icon:hover {
    background: var(--sand-50);
    color: var(--stone-700);
}

.nav-icon.active {
    background: rgba(181,104,75,0.06);
    color: var(--accent-rust);
    font-weight: 600;
    border-left-color: var(--accent-rust);
}

.nav-icon svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Text label replaces tooltip */
.nav-icon .tooltip {
    position: static;
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    font-weight: inherit;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    pointer-events: auto;
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-icon .tooltip::before {
    display: none;
}

.nav-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.nav-divider {
    height: 1px;
    background: var(--sand-100);
    margin: 4px 8px;
    flex-shrink: 0;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sand-400);
    text-align: left;
    padding: 6px 16px;
    margin: 4px 0 0;
    font-weight: 700;
    flex-shrink: 0;
}

/* Section */
.nav-section {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.nav-section.collapsed .nav-sub-items {
    display: none;
}

.nav-sub-items {
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--sand-100);
    padding: 8px 0 12px;
    flex-shrink: 0;
}

.sidebar-footer .nav-icon {
    padding: 5px 8px;
    color: var(--sand-400);
    font-size: 11px;
    border-left: 2px solid transparent;
}

.sidebar-footer .nav-icon:hover {
    color: var(--stone-600);
    background: var(--sand-50);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sand-200) 0%, var(--sand-300) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--stone-600);
    font-size: 9px;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    margin: 4px 16px;
}

.user-avatar-small:hover {
    box-shadow: var(--shadow-md);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Bottom Nav */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: 56px;
        bottom: 0;
        top: auto;
        flex-direction: row;
        padding: 0 8px;
        border-right: none;
        border-top: 1px solid var(--sand-300);
        justify-content: space-around;
        overflow: visible;
    }
    
    .sidebar-logo,
    .nav-section-header,
    .nav-divider,
    .nav-section-label,
    .sidebar-footer {
        display: none;
    }
    
    .sidebar-nav {
        flex-direction: row;
        padding: 0;
        overflow-x: auto;
        justify-content: center;
    }
    
    .nav-section-items {
        max-height: none !important;
        flex-direction: row;
        padding: 0;
        gap: 4px;
    }
    
    .nav-icon {
        padding: 8px;
        border-left: none;
        width: auto;
        height: auto;
    }
    .nav-icon .tooltip { display: none; }
    .nav-icon.active { border-left-color: transparent; }
}

/* ========================================
   PAGE HEADER
======================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--stone-900);
    margin-bottom: 4px;
    line-height: 1.2;
}

.page-header-left .welcome-text {
    font-weight: 400;
    color: var(--stone-600);
}

.page-header-left p {
    color: var(--sand-500);
    font-size: 11px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--stone-900);
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--sand-500);
    font-size: 11px;
}

.page-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
    }
    
    .page-header-left h1 {
        font-size: 24px;
    }
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 11px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(181, 104, 75, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(181, 104, 75, 0.4);
    color: var(--white);
}

.btn-secondary {
    background: var(--stone-800);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--stone-900);
    color: var(--white);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-moss) 0%, var(--accent-moss-light) 100%);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-rose) 0%, var(--accent-rose-light) 100%);
    color: var(--white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-amber) 0%, var(--accent-amber-light) 100%);
    color: var(--stone-900);
}

.btn-outline {
    background: var(--white);
    border: 1px solid var(--sand-300);
    color: var(--stone-700);
}

.btn-outline:hover {
    background: var(--sand-100);
    border-color: var(--sand-400);
    color: var(--stone-800);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--sand-300);
    color: var(--stone-700);
}

.btn-glass:hover {
    background: var(--white);
    color: var(--stone-800);
}

.btn-block {
    width: 100%;
}

/* ========================================
   CARDS
======================================== */
.card {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--sand-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sand-200);
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--stone-900);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    padding: 12px 14px;
}

.card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--sand-200);
    background: var(--sand-50);
}

/* ========================================
   STATS CARDS
======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    padding: 22px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--sand-200);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%); }
.stat-card.success::before { background: linear-gradient(90deg, var(--accent-moss) 0%, var(--accent-moss-light) 100%); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--accent-amber) 0%, var(--accent-amber-light) 100%); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--accent-rose) 0%, var(--accent-rose-light) 100%); }
.stat-card.info::before { background: linear-gradient(90deg, var(--accent-slate) 0%, var(--accent-slate-light) 100%); }

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--stone-900);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--sand-500);
    margin-top: 6px;
    font-weight: 500;
}

.stat-icon {
    position: absolute;
    right: 18px;
    bottom: 18px;
    font-size: 28px;
    opacity: 0.15;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--accent-moss); }
.stat-change.down { color: var(--accent-rose); }

/* ========================================
   FORMS
======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--stone-700);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--accent-rose);
}

.form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--sand-300);
    border-radius: var(--border-radius);
    font-size: 11px;
    color: var(--stone-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-rust);
    box-shadow: 0 0 0 3px rgba(181, 104, 75, 0.1);
}

.form-control::placeholder {
    color: var(--sand-500);
}

.form-control:disabled {
    background: var(--sand-100);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237D7465'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-text {
    font-size: 12px;
    color: var(--sand-500);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--accent-rose);
    margin-top: 6px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-rust);
    cursor: pointer;
}

/* ========================================
   TABLES
======================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--sand-200);
    background: var(--white);
    -webkit-overflow-scrolling: touch;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--stone-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--sand-50);
    border-bottom: 1px solid var(--sand-200);
}

.table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--sand-100);
    font-size: 11px;
    color: var(--stone-800);
}

.table tbody tr:hover {
    background: var(--sand-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   BADGES
======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
}

.badge-primary { background: rgba(181, 104, 75, 0.1); color: var(--accent-rust); }
.badge-success { background: rgba(107, 142, 107, 0.1); color: var(--accent-moss); }
.badge-warning { background: rgba(201, 168, 78, 0.1); color: var(--accent-amber); }
.badge-danger { background: rgba(181, 107, 125, 0.1); color: var(--accent-rose); }
.badge-info { background: rgba(107, 125, 142, 0.1); color: var(--accent-slate); }
.badge-secondary { background: var(--sand-200); color: var(--stone-700); }

/* Status Badges */
.badge-status-open { background: var(--sand-200); color: var(--stone-700); }
.badge-status-in_progress { background: rgba(107, 125, 142, 0.15); color: var(--accent-slate); }
.badge-status-review { background: rgba(201, 168, 78, 0.15); color: var(--accent-amber); }
.badge-status-completed { background: rgba(107, 142, 107, 0.15); color: var(--accent-moss); }
.badge-status-cancelled { background: rgba(181, 107, 125, 0.15); color: var(--accent-rose); }

/* Priority Badges */
.badge-priority-low { background: var(--sand-200); color: var(--stone-600); }
.badge-priority-medium { background: rgba(107, 125, 142, 0.15); color: var(--accent-slate); }
.badge-priority-high { background: rgba(201, 168, 78, 0.15); color: var(--accent-amber); }
.badge-priority-urgent { background: rgba(181, 104, 75, 0.15); color: var(--accent-rust); }

/* ========================================
   ALERTS
======================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: rgba(107, 142, 107, 0.1);
    border: 1px solid rgba(107, 142, 107, 0.2);
    color: var(--accent-moss);
}

.alert-danger {
    background: rgba(181, 107, 125, 0.1);
    border: 1px solid rgba(181, 107, 125, 0.2);
    color: var(--accent-rose);
}

.alert-warning {
    background: rgba(201, 168, 78, 0.1);
    border: 1px solid rgba(201, 168, 78, 0.2);
    color: var(--accent-amber);
}

.alert-info {
    background: rgba(107, 125, 142, 0.1);
    border: 1px solid rgba(107, 125, 142, 0.2);
    color: var(--accent-slate);
}

/* ========================================
   TABS
======================================== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px;
    background: var(--sand-50);
    border-bottom: 1px solid var(--sand-200);
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--stone-600);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tab:hover {
    background: var(--sand-200);
    color: var(--stone-800);
}

.tab.active {
    background: var(--stone-800);
    color: var(--white);
}

.tab-count {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--sand-200);
    color: var(--stone-600);
}

.tab.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* ========================================
   TASK ITEMS
======================================== */
.task-list {
    padding: 16px;
}

.task-item {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 18px 20px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    margin-bottom: 12px;
    border: 1px solid var(--sand-200);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.task-item:hover {
    border-color: var(--sand-400);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.task-priority-bar {
    width: 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.task-priority-bar.urgent { background: var(--accent-rust); }
.task-priority-bar.high { background: var(--accent-amber); }
.task-priority-bar.medium { background: var(--accent-slate); }
.task-priority-bar.low { background: var(--sand-400); }

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--sand-400);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-checkbox:hover {
    border-color: var(--accent-rust);
    background: rgba(181, 104, 75, 0.1);
}

.task-checkbox.checked {
    background: var(--accent-moss);
    border-color: var(--accent-moss);
    color: var(--white);
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    color: var(--stone-900);
    margin-bottom: 6px;
    font-size: 15px;
}

.task-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--sand-500);
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.task-due-badge.normal { background: var(--sand-100); color: var(--stone-600); }
.task-due-badge.today { background: rgba(201, 168, 78, 0.15); color: var(--accent-amber); }
.task-due-badge.overdue { background: rgba(181, 104, 75, 0.15); color: var(--accent-rust); }

/* ========================================
   QUICK ACTIONS GRID
======================================== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-btn {
    padding: 16px;
    border-radius: var(--border-radius);
    background: var(--white);
    border: 1px solid var(--sand-200);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: block;
}

.quick-btn:hover {
    background: var(--sand-100);
    border-color: var(--sand-400);
    transform: translateY(-2px);
}

.quick-btn-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.quick-btn-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--stone-700);
}

.quick-btn.primary {
    background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%);
    border: none;
    color: var(--white);
}

.quick-btn.primary:hover {
    box-shadow: 0 6px 16px rgba(181, 104, 75, 0.3);
}

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

/* ========================================
   ACTIVITY FEED
======================================== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sand-200);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background: var(--sand-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 13px;
    color: var(--stone-700);
    line-height: 1.5;
}

.activity-time {
    font-size: 11px;
    color: var(--sand-500);
    margin-top: 4px;
}

/* ========================================
   MINI TASK LIST
======================================== */
.mini-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sand-200);
}

.mini-task:last-child {
    border-bottom: none;
}

.mini-task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mini-task-info {
    flex: 1;
    min-width: 0;
}

.mini-task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--stone-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-task-sub {
    font-size: 11px;
    color: var(--sand-500);
}

/* ========================================
   EMPTY STATE
======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--sand-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--stone-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========================================
   AVATAR
======================================== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sand-300) 0%, var(--sand-400) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--stone-700);
    font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 20px;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid var(--white);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========================================
   PROGRESS BAR
======================================== */
.progress {
    height: 8px;
    background: var(--sand-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--accent-moss) 0%, var(--accent-moss-light) 100%);
}

/* ========================================
   DROPDOWN
======================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--sand-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 8px 0;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--stone-700);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--sand-100);
    color: var(--stone-900);
}

.dropdown-divider {
    height: 1px;
    background: var(--sand-200);
    margin: 8px 0;
}

/* ========================================
   MODAL
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 34, 32, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sand-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--stone-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--stone-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--sand-100);
    color: var(--stone-900);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--sand-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   UTILITIES
======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--accent-rust); }
.text-success { color: var(--accent-moss); }
.text-warning { color: var(--accent-amber); }
.text-danger { color: var(--accent-rose); }
.text-secondary { color: var(--sand-500); }
.text-muted { color: var(--stone-600); }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.p-0 { padding: 0; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: 50%; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }

/* ========================================
   GRID LAYOUTS
======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

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

@media (max-width: 576px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   VIEW TABS (for Tasks pages)
======================================== */
.view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.view-tab {
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--stone-600);
    text-decoration: none;
    border: 1px solid var(--sand-300);
    background: var(--white);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-tab:hover {
    background: var(--sand-100);
    color: var(--stone-800);
}

.view-tab.active {
    background: var(--stone-800);
    color: var(--white);
    border-color: var(--stone-800);
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .sidebar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background: white;
    }
}

/* ========================================
   KANBAN BOARD - Narrower Columns
======================================== */
.kanban-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
    background: var(--sand-100);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 12px 14px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid transparent;
}

.kanban-column-header .count {
    background: var(--sand-300);
    color: var(--stone-700);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.kanban-column.open .kanban-column-header { border-color: var(--sand-400); }
.kanban-column.in-progress .kanban-column-header { border-color: var(--accent-slate); }
.kanban-column.review .kanban-column-header { border-color: var(--accent-amber); }
.kanban-column.completed .kanban-column-header { border-color: var(--accent-moss); }

.kanban-column-body {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.kanban-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--sand-400);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card.urgent { border-left-color: var(--accent-rust); }
.kanban-card.high { border-left-color: var(--accent-amber); }
.kanban-card.medium { border-left-color: var(--accent-slate); }
.kanban-card.low { border-left-color: var(--sand-400); }

.kanban-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--stone-900);
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-meta {
    font-size: 11px;
    color: var(--sand-500);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kanban-card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-card-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.kanban-card-badge.high {
    background: rgba(201, 168, 78, 0.15);
    color: var(--accent-amber);
}

.kanban-card-badge.urgent {
    background: rgba(181, 104, 75, 0.15);
    color: var(--accent-rust);
}

.kanban-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--sand-500);
    font-size: 12px;
}

/* ========================================
   VIEW TABS - Compact
======================================== */
.view-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.view-tab {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--stone-600);
    text-decoration: none;
    border: 1px solid var(--sand-300);
    background: var(--white);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.view-tab:hover {
    background: var(--sand-100);
    color: var(--stone-800);
}

.view-tab.active {
    background: var(--stone-800);
    color: var(--white);
    border-color: var(--stone-800);
}

.view-tab-new {
    background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-light) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 8px rgba(181, 104, 75, 0.25);
}

.view-tab-new:hover {
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(181, 104, 75, 0.35);
}

/* ========================================
   EMPLOYEE/TEAM CARDS - Smaller Photos
======================================== */
.employee-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--sand-200);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.employee-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.employee-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--sand-200) 0%, var(--sand-300) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--stone-700);
    overflow: hidden;
}

.employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.employee-avatar-xs {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.employee-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--stone-900);
    margin-bottom: 2px;
}

.employee-role {
    font-size: 12px;
    color: var(--sand-500);
}

.employee-dept {
    font-size: 11px;
    color: var(--accent-rust);
    margin-top: 4px;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Employee List Row */
.employee-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--sand-200);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.employee-row:hover {
    background: var(--sand-50);
    border-color: var(--sand-300);
}

.employee-row .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

/* ========================================
   PROFILE PAGE - Compact Layout
======================================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--white);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--sand-200);
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sand-200) 0%, var(--sand-300) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: var(--stone-700);
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--stone-900);
    margin-bottom: 4px;
}

.profile-info .role {
    font-size: 14px;
    color: var(--accent-rust);
    font-weight: 500;
}

.profile-info .department {
    font-size: 13px;
    color: var(--sand-500);
    margin-top: 2px;
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin-left: auto;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--stone-900);
}

.profile-stat-label {
    font-size: 11px;
    color: var(--sand-500);
    text-transform: uppercase;
}

/* ========================================
   FILTERS ROW - Compact
======================================== */
.filters-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--sand-300);
    border-radius: 8px;
    font-size: 13px;
    color: var(--stone-700);
    background: var(--white);
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237D7465'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-rust);
}

.search-input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--sand-300);
    border-radius: 8px;
    font-size: 13px;
    width: 200px;
    background: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23A99D8A'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-rust);
}

.filter-btn {
    padding: 8px 14px;
    border: 1px solid var(--accent-rust);
    background: var(--accent-rust);
    color: var(--white);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--accent-rust-light);
}

/* ========================================
   MOBILE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 72px;
    }
    
    .sidebar {
        width: 100%;
        height: 56px;
        bottom: 0;
        top: auto;
        flex-direction: row;
        padding: 0 8px;
        border-right: none;
        border-top: 1px solid var(--sand-300);
        justify-content: space-around;
        overflow-x: auto;
    }
    
    .sidebar-logo {
        display: none;
    }
    
    .sidebar-nav {
        flex-direction: row;
        gap: 4px;
        padding: 8px 0;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: center;
        align-items: center;
    }
    
    .nav-divider,
    .nav-section-label,
    .sidebar-footer {
        display: none;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-icon .tooltip {
        display: none;
    }
    
    .kanban-container {
        padding: 12px;
    }
    
    .kanban-column {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }
    
    .view-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }
    
    .filters-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header-left h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
