/* =====================================================
   Kubanza Leads CRM - Google Material Design System
   ===================================================== */

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

/* CSS Variables */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --primary-hover: #174ea6;
    --surface: #ffffff;
    --background: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --border: #dadce0;
    --border-light: #e8eaed;
    --success: #188038;
    --success-bg: #e6f4ea;
    --warning: #f9ab00;
    --warning-bg: #fef7e0;
    --danger: #d93025;
    --danger-bg: #fce8e6;
    --info: #1a73e8;
    --info-bg: #e8f0fe;
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --header-height: 64px;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-lg: 0 1px 3px 0 rgba(60,64,67,0.3), 0 8px 16px 4px rgba(60,64,67,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Pipeline colors */
    --stage-prospeccao: #1a73e8;
    --stage-contacto: #7c4dff;
    --stage-diagnostico: #f9ab00;
    --stage-apresentacao: #ff6d00;
    --stage-proposta: #e91e63;
    --stage-fecho: #188038;
    --stage-suporte: #00bcd4;
    --stage-perdido: #d93025;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===================== HEADER ===================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(60,64,67,0.1);
}

.header-menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background var(--transition);
    flex-shrink: 0;
}

.header-menu-btn:hover {
    background: var(--background);
}

.header-menu-btn svg {
    width: 24px;
    height: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.header-logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.header-spacer {
    flex: 1;
}

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

.header-user-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-user-role {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    font-weight: 500;
    text-transform: capitalize;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: box-shadow var(--transition);
}

.header-avatar:hover {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-logout {
    font-size: 13px;
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    transition: background var(--transition);
}

.header-logout:hover {
    background: var(--danger-bg);
}

.header-profile-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    transition: background var(--transition);
}

.header-profile-link:hover {
    background: var(--background);
    color: var(--primary);
}

/* ===================== SIDEBAR ===================== */
.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 90;
    padding: 8px 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-section {
    padding: 4px 12px;
    margin-bottom: 4px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 16px 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    height: 40px;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    margin: 1px 0;
}

.sidebar-item:hover {
    background: var(--background);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

/* ===================== MAIN CONTENT ===================== */
.app-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 24px 32px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar collapsed state */
body.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .app-main {
    margin-left: 0;
}

/* ===================== CARDS ===================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 24px;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-elevated {
    box-shadow: var(--shadow-sm);
}

.card-elevated:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===================== STAT CARDS ===================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.purple { background: #f3e8fd; color: #7c4dff; }

.stat-info { min-width: 0; }

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.5;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(26,115,232,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

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

.btn-success:hover {
    background: #156d2f;
}

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

.btn-danger:hover {
    background: #b3261e;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--background);
    color: var(--text-primary);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

/* ===================== TABLES ===================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

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

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

/* ===================== BADGES ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    gap: 4px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-prospeccao { background: #e8f0fe; color: #1a73e8; }
.badge-prospeccao::before { background: #1a73e8; }
.badge-contacto { background: #f3e8fd; color: #7c4dff; }
.badge-contacto::before { background: #7c4dff; }
.badge-diagnostico { background: #fef7e0; color: #e37400; }
.badge-diagnostico::before { background: #f9ab00; }
.badge-apresentacao { background: #fff3e0; color: #e65100; }
.badge-apresentacao::before { background: #ff6d00; }
.badge-proposta { background: #fce4ec; color: #c2185b; }
.badge-proposta::before { background: #e91e63; }
.badge-fecho { background: #e6f4ea; color: #188038; }
.badge-fecho::before { background: #188038; }
.badge-suporte { background: #e0f7fa; color: #00838f; }
.badge-suporte::before { background: #00bcd4; }
.badge-perdido { background: #fce8e6; color: #d93025; }
.badge-perdido::before { background: #d93025; }

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-success::before { background: var(--success); }
.badge-warning { background: var(--warning-bg); color: #e37400; }
.badge-warning::before { background: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-danger::before { background: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-info::before { background: var(--info); }

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

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

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

.form-full {
    grid-column: 1 / -1;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===================== PIPELINE ===================== */
.pipeline-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.pipeline-column {
    min-width: 260px;
    max-width: 300px;
    flex: 1;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.pipeline-column-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pipeline-column-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pipeline-column-count {
    font-size: 12px;
    font-weight: 600;
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.pipeline-column-body {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pipeline-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.pipeline-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pipeline-card-company {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pipeline-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.pipeline-card-value {
    font-weight: 600;
    color: var(--success);
}

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

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #a8dab5;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f5c6c2;
}

.alert-warning {
    background: var(--warning-bg);
    color: #e37400;
    border: 1px solid #fde293;
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid #aecbfa;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--background);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

/* ===================== PROGRESS BAR ===================== */
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width 0.5s ease;
}

/* ===================== TIMELINE ===================== */
.timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 0;
    overflow-x: auto;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    position: relative;
    flex: 1;
}

.timeline-step::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: var(--border-light);
    z-index: 0;
}

.timeline-step:last-child::after {
    display: none;
}

.timeline-step.completed::after {
    background: var(--success);
}

.timeline-step.active::after {
    background: linear-gradient(90deg, var(--primary) 50%, var(--border-light) 50%);
}

.timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border-light);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border-light);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-step.completed .timeline-dot {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}

.timeline-step.active .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(26,115,232,0.15);
}

.timeline-dot svg {
    width: 14px;
    height: 14px;
    color: white;
}

.timeline-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
}

.timeline-step.completed .timeline-label,
.timeline-step.active .timeline-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===================== PERMISSIONS TABLE ===================== */
.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table th,
.permissions-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.permissions-table th:first-child,
.permissions-table td:first-child {
    text-align: left;
}

.permissions-table thead th {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--background);
}

.permissions-toggle {
    appearance: none;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border);
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
}

.permissions-toggle::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.permissions-toggle:checked {
    background: var(--primary);
}

.permissions-toggle:checked::after {
    transform: translateX(16px);
}

/* ===================== LOGIN PAGE ===================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        top: var(--header-height);
        background: rgba(0,0,0,0.3);
        z-index: 80;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .app-main {
        padding: 16px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card {
        padding: 16px;
    }

    .pipeline-board {
        flex-direction: column;
    }

    .pipeline-column {
        min-width: unset;
        max-width: unset;
    }

    .login-card {
        padding: 32px 24px;
    }

    .header-user-name {
        display: none;
    }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===================== UTILITIES ===================== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Print */
@media print {
    .app-sidebar, .app-header, .no-print { display: none !important; }
    .app-main { margin: 0 !important; padding: 0 !important; }
}
