@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --exsto-primary: #6366f1;
    --exsto-primary-dark: #4f46e5;
    --exsto-primary-light: #eef2ff;
    --exsto-accent: #06b6d4;
    --exsto-success: #10b981;
    --exsto-warning: #f59e0b;
    --exsto-danger: #ef4444;
    --exsto-sidebar: #0f172a;
    --exsto-sidebar-hover: #1e293b;
    --exsto-surface: #ffffff;
    --exsto-bg: #f1f5f9;
    --exsto-border: #e2e8f0;
    --exsto-text: #0f172a;
    --exsto-muted: #64748b;
    --exsto-radius: 0.75rem;
    --exsto-shadow: 0 1px 3px rgb(15 23 42 / 0.08), 0 4px 12px rgb(15 23 42 / 0.04);
    --exsto-shadow-lg: 0 8px 24px rgb(15 23 42 / 0.1);
}

* { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

body { background: var(--exsto-bg); color: var(--exsto-text); }

.exsto-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: rgb(255 255 255 / 0.08);
    color: #fff;
    transform: translateX(2px);
}

.nav-link-active {
    background: linear-gradient(135deg, var(--exsto-primary) 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgb(99 102 241 / 0.35);
}

.exsto-card {
    background: var(--exsto-surface);
    border: 1px solid var(--exsto-border);
    border-radius: var(--exsto-radius);
    box-shadow: var(--exsto-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.exsto-card:hover { box-shadow: var(--exsto-shadow-lg); }

.exsto-stat {
    background: var(--exsto-surface);
    border: 1px solid var(--exsto-border);
    border-radius: var(--exsto-radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.exsto-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--stat-accent, var(--exsto-primary));
    border-radius: 4px 0 0 4px;
}

.exsto-btn-primary {
    background: linear-gradient(135deg, var(--exsto-primary) 0%, #7c3aed 100%);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.exsto-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgb(99 102 241 / 0.4);
}

.exsto-btn-ghost {
    background: white;
    border: 1px solid var(--exsto-border);
    color: var(--exsto-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.exsto-btn-ghost:hover { border-color: var(--exsto-primary); color: var(--exsto-primary); }

.exsto-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.view-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--exsto-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.view-tab:hover { color: var(--exsto-primary); }

.view-tab-active {
    color: var(--exsto-primary);
    border-bottom-color: var(--exsto-primary);
}

/* Kanban */
.kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex: 1;
    background: #f8fafc;
    border-radius: var(--exsto-radius);
    border: 1px solid var(--exsto-border);
}

.kanban-card {
    background: white;
    border: 1px solid var(--exsto-border);
    border-radius: 0.625rem;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kanban-card:hover {
    box-shadow: var(--exsto-shadow-lg);
    transform: translateY(-2px);
    border-color: #c7d2fe;
}

.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }

.kanban-drop-hover { background: var(--exsto-primary-light); border-color: #a5b4fc; }

/* Gantt */
.gantt-bar {
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--exsto-primary), #818cf8);
    position: absolute;
    top: 4px;
    min-width: 8px;
    transition: width 0.3s ease;
}

.gantt-row { position: relative; height: 36px; border-bottom: 1px solid var(--exsto-border); }

/* Table */
.exsto-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.exsto-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--exsto-muted);
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--exsto-border);
}
.exsto-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--exsto-border);
    font-size: 0.875rem;
}
.exsto-table tbody tr:hover td { background: #f8fafc; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.35s ease forwards; }

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.pulse-soft { animation: pulse-soft 2s ease infinite; }

/* Calendar */
.cal-day {
    min-height: 100px;
    border: 1px solid var(--exsto-border);
    border-radius: 0.5rem;
    padding: 0.375rem;
    background: white;
}
.cal-day-today { border-color: var(--exsto-primary); background: var(--exsto-primary-light); }
.cal-event {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    background: #e0e7ff;
    color: #4338ca;
    truncate: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.timeline-item { position: relative; padding-left: 1.5rem; padding-bottom: 1.25rem; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.3125rem;
    top: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--exsto-primary);
}
.timeline-item::after {
    content: '';
    position: absolute;
    left: 0.5625rem;
    top: 1rem;
    bottom: 0;
    width: 2px;
    background: var(--exsto-border);
}
.timeline-item:last-child::after { display: none; }

/* Forms */
.exsto-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--exsto-muted);
    margin-bottom: 0.375rem;
}

.exsto-input,
select.exsto-input,
textarea.exsto-input {
    width: 100%;
    border: 1px solid var(--exsto-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.exsto-input:focus {
    outline: none;
    border-color: var(--exsto-primary);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.12);
}

.exsto-form-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .exsto-form-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.exsto-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exsto-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgb(16 185 129 / 0.35);
}

.exsto-btn-danger {
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
}

.exsto-btn-danger:hover { color: #b91c1c; }

.exsto-detail-list dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--exsto-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.exsto-detail-list dd {
    font-size: 0.875rem;
    color: var(--exsto-text);
    margin-bottom: 0.75rem;
}

.exsto-link { color: var(--exsto-primary); font-weight: 500; }
.exsto-link:hover { text-decoration: underline; }

/* Mobile layout */
[x-cloak] { display: none !important; }

.exsto-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 3.5rem;
    padding: 0 1rem;
    background: var(--exsto-surface);
    border-bottom: 1px solid var(--exsto-border);
    box-shadow: var(--exsto-shadow);
}

.exsto-mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--exsto-border);
    background: #fff;
    color: var(--exsto-text);
    transition: border-color 0.15s, color 0.15s;
}

.exsto-mobile-menu-btn:hover {
    border-color: var(--exsto-primary);
    color: var(--exsto-primary);
}

.exsto-mobile-brand {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--exsto-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
}

.exsto-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.exsto-page-header h1 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.exsto-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.exsto-table-wrap .exsto-table,
.exsto-table-wrap table {
    min-width: 560px;
}

@media (max-width: 1023px) {
    .kanban-board,
    .exsto-kanban-scroll {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-column {
        min-width: 260px;
        flex-shrink: 0;
    }

    .exsto-card { overflow-x: auto; }

    .cal-day { min-height: 72px; }

    .gantt-scroll { overflow-x: auto; }
}

@media (max-width: 639px) {
    .exsto-btn-primary,
    .exsto-btn-ghost,
    .exsto-btn-success {
        width: 100%;
        justify-content: center;
    }

    .exsto-page-header .exsto-btn-primary {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }
}
