:root {
    --navy: #14243a;
    --navy-2: #1d3554;
    --gold: #d9902f;
    --gold-dark: #b96b18;
    --gold-soft: #fff3e2;
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --success: #0f9f6e;
    --danger: #dc3655;
    --blue: #2879d7;
    --shadow: 0 12px 30px rgba(20, 36, 58, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-page, .install-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 10%, rgba(217, 144, 47, .16), transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(47, 79, 118, .16), transparent 30%),
        var(--bg);
}

.auth-card, .install-card {
    width: min(100%, 520px);
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: clamp(28px, 5vw, 48px);
    box-shadow: 0 28px 70px rgba(20,36,58,.12);
}

.install-card { width: min(100%, 760px); }
.auth-logo { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto; border-radius: 18px; background: var(--gold); color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 12px 25px rgba(217,144,47,.25); }
.eyebrow { margin-top: 22px; color: var(--gold-dark); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.auth-card { text-align: center; }
.auth-card h1, .install-card h1 { margin: 10px 0 0; color: var(--navy); font-size: clamp(28px, 5vw, 40px); line-height: 1.08; letter-spacing: -.04em; }
.auth-copy, .install-card > p { margin: 15px auto 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-form { display: grid; gap: 16px; margin-top: 28px; text-align: left; }
.auth-form label, .install-form label, .form-field { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.auth-form input, .install-form input, .form-control {
    width: 100%; min-height: 42px; border: 1px solid #d8e0e9; border-radius: 10px; outline: none; background: #fff; padding: 9px 12px; color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus, .install-form input:focus, .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,144,47,.14); }
.install-heading { display: flex; align-items: center; gap: 18px; }
.install-heading .auth-logo { flex: 0 0 auto; margin: 0; }
.install-heading .eyebrow { margin-top: 0; }
.install-form { display: grid; gap: 18px; margin-top: 26px; }
.install-form fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 0; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.install-form legend { padding: 0 8px; color: var(--navy); font-size: 14px; font-weight: 750; }
.span-2 { grid-column: 1 / -1; }
.install-note { text-align: center; font-size: 12px !important; }
.install-note code { color: var(--danger); }

.alert { margin-top: 20px; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.55; text-align: left; }
.alert.error { border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; }
.alert ul { margin: 7px 0 0; padding-left: 18px; }

.app-body { overflow: hidden; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 258px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; padding: 18px 14px 14px; transition: transform .22s ease; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand-logo { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: white; font-weight: 850; box-shadow: 0 7px 16px rgba(217,144,47,.22); }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { color: var(--navy); font-size: 16px; }
.brand small { margin-top: 4px; color: #94a3b8; font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.nav { display: grid; gap: 5px; margin-top: 8px; }
.nav::before { content: "RADNI PROSTOR"; padding: 0 10px 7px; color: #94a3b8; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; border: 0; border-radius: 10px; background: transparent; padding: 0 11px; color: #526174; font-size: 13px; font-weight: 650; text-align: left; transition: background .15s, color .15s; }
.nav-item > span { width: 20px; color: #8390a0; font-size: 17px; text-align: center; }
.nav-item:hover { background: #f8fafc; color: var(--navy); }
.nav-item.active { background: var(--gold-soft); color: #9f5d16; }
.nav-item.active > span { color: var(--gold-dark); }
.nav-item i { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; border-radius: 999px; background: var(--gold); color: white; font-size: 10px; font-style: normal; }
.quick-card { margin: auto 4px 14px; border-radius: 18px; background: var(--navy); padding: 17px; color: #fff; box-shadow: 0 18px 30px rgba(20,36,58,.16); }
.quick-card::before { content: "✦"; color: #f5bc6d; font-size: 20px; }
.quick-card b { display: block; margin-top: 11px; font-size: 13px; }
.quick-card p { margin: 6px 0 12px; color: #c8d1de; font-size: 11px; line-height: 1.55; }
.user-card { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 14px 7px 0; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 750; }
.avatar.small { width: 30px; height: 30px; font-size: 10px; }
.user-meta { min-width: 0; display: grid; flex: 1; }
.user-meta strong { overflow: hidden; color: #334155; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { margin-top: 2px; color: #94a3b8; font-size: 10px; }
.logout { border: 0; background: transparent; color: #94a3b8; font-size: 18px; }
.sidebar-backdrop { display: none; }

.workspace { width: calc(100% - 258px); min-width: 0; min-height: 100vh; margin-left: 258px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(226,232,240,.9); background: rgba(255,255,255,.92); padding: 0 28px; backdrop-filter: blur(14px); }
.mobile-menu { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font-size: 18px; }
.page-heading { min-width: 0; flex: 1; }
.page-heading h1 { margin: 0; color: var(--navy); font-size: 18px; letter-spacing: -.02em; }
.page-heading p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; width: min(250px, 25vw); }
.search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #f8fafc; padding: 0 12px 0 34px; color: var(--text); font-size: 13px; }
.icon-button { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font-size: 18px; }
.icon-button i { position: absolute; right: -5px; top: -5px; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; font-size: 9px; font-style: normal; }
.content { width: min(100%, 1540px); margin: 0 auto; padding: 26px 28px 42px; }

.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 0 14px; font-size: 12px; font-weight: 700; text-decoration: none; transition: transform .15s, background .15s, border .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: white; }
.btn.gold:hover { background: #c57a23; }
.btn.light { border-color: rgba(255,255,255,.2); background: #fff; color: var(--navy); }
.btn.outline { border-color: var(--line); background: white; color: #475569; }
.btn.ghost { background: transparent; color: #526174; }
.btn.danger { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.btn.wide { width: 100%; }
.btn.large { min-height: 46px; }
.btn:disabled { cursor: not-allowed; opacity: .6; transform: none; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.toolbar-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 5px 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.card { border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f5; padding: 18px 20px; }
.card-header h2, .card-header h3 { margin: 0; color: var(--navy); font-size: 14px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-radius: 24px; background: var(--navy); padding: 28px; color: white; box-shadow: 0 20px 45px rgba(20,36,58,.14); }
.hero::after { content: ""; position: absolute; right: -90px; top: -130px; z-index: -1; width: 430px; height: 430px; border-radius: 50%; background: radial-gradient(circle, rgba(217,144,47,.38), transparent 68%); }
.hero .eyebrow { margin: 0; color: #f1b862; }
.hero h2 { max-width: 700px; margin: 10px 0 0; font-size: clamp(23px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.hero p { margin: 10px 0 0; color: #cbd5e1; font-size: 13px; }
.hero-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 18px; }
.metric { min-height: 145px; padding: 18px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: var(--gold-soft); color: var(--gold-dark); font-size: 17px; }
.metric-icon.blue { background: #eaf4ff; color: #2563a8; }
.metric-icon.green { background: #eafaf3; color: var(--success); }
.metric-icon.navy { background: #edf1f5; color: var(--navy); }
.metric b { display: block; margin-top: 14px; color: var(--navy); font-size: 24px; letter-spacing: -.03em; }
.metric strong { display: block; margin-top: 3px; color: #475569; font-size: 12px; }
.metric small { display: block; margin-top: 5px; color: #94a3b8; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .7fr); gap: 18px; margin-top: 18px; }
.list { margin: 0; padding: 0; list-style: none; }
.list-row { display: flex; align-items: center; gap: 13px; width: 100%; border: 0; border-bottom: 1px solid #edf1f5; background: white; padding: 14px 20px; color: inherit; text-align: left; transition: background .15s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f8fafc; }
.project-color { width: 5px; height: 44px; flex: 0 0 auto; border-radius: 999px; }
.row-main { min-width: 0; flex: 1; }
.row-main strong { display: block; overflow: hidden; color: #26354a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { display: block; margin-top: 4px; color: #8290a2; font-size: 10px; }
.row-side { flex: 0 0 auto; color: #334155; font-size: 11px; font-weight: 700; text-align: right; }
.row-side small { display: block; margin-top: 3px; color: #94a3b8; font-weight: 500; }
.progress { height: 6px; overflow: hidden; margin-top: 9px; border-radius: 99px; background: #edf1f5; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.today-total { color: var(--gold-dark); font-size: 22px; }
.today-content { padding: 18px; }
.time-mini { display: flex; gap: 10px; margin-bottom: 15px; }
.time-mini-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--gold-soft); color: var(--gold-dark); }
.time-mini strong { color: #334155; font-size: 11px; }
.time-mini b { margin-left: 5px; color: var(--gold-dark); font-size: 10px; }
.time-mini p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.project-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 17px 36px rgba(20,36,58,.1); }
.project-card > i { display: block; height: 5px; }
.project-card-body { padding: 18px; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.tag.active { border-color: #b9ead7; background: #edfbf5; color: #087a53; }
.tag.paused { border-color: #f8dba9; background: #fff7e9; color: #9f5d16; }
.tag.completed { background: #f8fafc; }
.tag.urgent { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.tag.high { border-color: #f8dba9; background: #fff7e9; color: #9f5d16; }
.project-card h3 { margin: 12px 0 0; color: var(--navy); font-size: 16px; letter-spacing: -.02em; }
.project-card .client { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.project-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; border-radius: 12px; background: #f8fafc; padding: 11px; }
.project-info small { display: block; color: #94a3b8; font-size: 9px; }
.project-info strong { display: block; overflow: hidden; margin-top: 4px; color: #475569; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.project-progress { margin-top: 16px; }
.project-progress > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.project-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; border-top: 1px solid #edf1f5; padding-top: 13px; color: var(--muted); font-size: 9px; }

.tabs { display: inline-flex; gap: 3px; border-radius: 10px; background: #e9eef3; padding: 3px; }
.tab { min-height: 31px; border: 0; border-radius: 8px; background: transparent; padding: 0 11px; color: var(--muted); font-size: 11px; font-weight: 650; }
.tab.active { background: white; color: var(--navy); box-shadow: 0 2px 5px rgba(20,36,58,.07); }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; }
.kanban-column { border-radius: 16px; background: #eaf0f5; padding: 11px; }
.kanban-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; color: #334155; font-size: 11px; font-weight: 750; }
.kanban-title span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #94a3b8; }
.kanban-title.blue span:first-child::before { background: var(--blue); }
.kanban-title.green span:first-child::before { background: var(--success); }
.kanban-count { min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 99px; background: white; color: var(--muted); font-size: 9px; }
.task-card { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 13px; box-shadow: 0 4px 12px rgba(20,36,58,.04); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.task-card h4 { margin: 10px 0 0; color: #26354a; font-size: 12px; line-height: 1.45; }
.task-card p { display: -webkit-box; overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 9px; }
.task-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card select { width: 100%; height: 32px; margin-top: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 0 8px; color: #475569; font-size: 10px; }

.hours-grid { display: grid; grid-template-columns: minmax(310px, .8fr) minmax(0, 1.3fr); gap: 18px; margin-top: 18px; }
.chart-card { padding: 20px; }
.chart { height: 220px; display: flex; align-items: flex-end; gap: 5px; border-bottom: 1px solid var(--line); padding-top: 28px; }
.bar-wrap { position: relative; height: 100%; min-width: 5px; display: flex; flex: 1; align-items: flex-end; }
.bar { width: 100%; min-height: 7px; border-radius: 5px 5px 0 0; background: rgba(217,144,47,.86); }
.bar-wrap:hover::after { content: attr(data-label); position: absolute; bottom: calc(var(--height) + 6px); left: 50%; transform: translateX(-50%); z-index: 2; border-radius: 6px; background: var(--navy); padding: 4px 6px; color: white; font-size: 9px; white-space: nowrap; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 10px; color: #94a3b8; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { border-bottom: 1px solid var(--line); padding: 11px 14px; color: #64748b; font-size: 9px; font-weight: 750; text-align: left; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.data-table td { border-bottom: 1px solid #edf1f5; padding: 11px 14px; color: #526174; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table strong { color: #334155; }
.table-user { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.table-user span:last-child { display: grid; }
.table-user small { margin-top: 2px; color: #94a3b8; }

.message-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.message-list { overflow: hidden; }
.message-row { display: flex; gap: 12px; width: 100%; border: 0; border-bottom: 1px solid #edf1f5; background: white; padding: 15px 18px; color: inherit; text-align: left; }
.message-row.unread { background: #fffbf4; }
.message-row:hover { background: #f8fafc; }
.message-row:last-child { border-bottom: 0; }
.message-body { min-width: 0; flex: 1; }
.message-line { display: flex; align-items: center; gap: 7px; }
.message-line strong { overflow: hidden; color: #334155; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); }
.message-line time { margin-left: auto; color: #94a3b8; font-size: 9px; }
.message-body h4 { margin: 5px 0 0; color: #475569; font-size: 11px; }
.message-body p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.empty { min-height: 260px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 17px; background: white; padding: 35px; text-align: center; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; border-radius: 15px; background: #edf1f5; color: #64748b; font-size: 20px; }
.empty h3 { margin: 14px 0 0; color: var(--navy); font-size: 15px; }
.empty p { max-width: 430px; margin: 7px auto 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty .btn { margin-top: 16px; }
.onboarding { min-height: calc(100vh - 140px); display: grid; place-items: center; text-align: center; }
.onboarding > div { max-width: 650px; }
.onboarding .empty-icon { width: 64px; height: 64px; border-radius: 22px; background: var(--gold-soft); color: var(--gold-dark); font-size: 28px; }
.onboarding h2 { margin: 18px 0 0; color: var(--navy); font-size: clamp(27px, 4vw, 40px); letter-spacing: -.04em; }
.onboarding p { margin: 12px auto 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.onboarding .hero-actions { justify-content: center; margin-top: 22px; }
.loading { min-height: calc(100vh - 130px); display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.loading span { width: 18px; height: 18px; border: 2px solid #dce3ea; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.modal-panel { position: relative; z-index: 1; width: min(100%, 650px); max-height: min(90vh, 850px); overflow-y: auto; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(15,23,42,.3); animation: modalIn .18s ease-out; }
.modal-panel.wide { width: min(100%, 850px); }
@keyframes modalIn { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-close { position: absolute; right: 15px; top: 14px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f1f5f9; color: #64748b; font-size: 20px; }
.modal-head { padding: 22px 56px 16px 22px; }
.modal-head h2 { margin: 0; color: var(--navy); font-size: 19px; letter-spacing: -.025em; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.modal-form { display: grid; gap: 15px; padding: 4px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-control { min-height: 40px; }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: auto; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.check-user { display: flex; align-items: center; gap: 8px; border-radius: 9px; padding: 7px; color: #475569; font-size: 11px; font-weight: 600; }
.check-user:hover { background: #f8fafc; }
.check-user input { accent-color: var(--gold); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.project-detail-bar { height: 7px; }
.detail-content { display: grid; gap: 20px; padding: 0 22px 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-box { border-radius: 12px; background: #f8fafc; padding: 12px; }
.detail-box small { color: #94a3b8; font-size: 9px; }
.detail-box strong { display: block; margin-top: 4px; color: #475569; font-size: 11px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 18px; }
.detail-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-title h3 { margin: 0; color: var(--navy); font-size: 12px; }
.detail-title small { color: #94a3b8; }
.member-list { display: flex; flex-wrap: wrap; gap: 7px; }
.member-chip { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px 4px 4px; color: #475569; font-size: 10px; font-weight: 650; }
.note-form { display: flex; align-items: flex-start; gap: 8px; }
.note-form textarea { min-height: 72px; }
.note { margin-top: 9px; border-radius: 12px; background: #f8fafc; padding: 12px; }
.note-head { display: flex; justify-content: space-between; gap: 8px; }
.note-head strong { color: #475569; font-size: 10px; }
.note-head time { color: #94a3b8; font-size: 9px; }
.note p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; }

.toast-stack { position: fixed; right: 18px; top: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 36px)); border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 12px; background: white; padding: 12px 14px; color: #334155; font-size: 11px; font-weight: 650; box-shadow: 0 16px 40px rgba(15,23,42,.16); animation: toastIn .2s ease-out; }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

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

@media (max-width: 900px) {
    .app-body { overflow: auto; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.48); }
    .sidebar-backdrop.open { display: block; }
    .workspace { width: 100%; margin-left: 0; }
    .mobile-menu { display: block; }
    .dashboard-grid, .hours-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: 1fr; }
    .search { display: none; }
}

@media (max-width: 640px) {
    .topbar { height: 64px; padding: 0 13px; }
    .page-heading p { display: none; }
    .topbar > .btn span { display: none; }
    .content { padding: 16px 13px 32px; }
    .hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .hero-actions { width: 100%; flex-wrap: wrap; }
    .hero-actions .btn { flex: 1; }
    .metrics, .projects-grid { grid-template-columns: 1fr; }
    .metric { min-height: 130px; }
    .form-grid, .checkbox-grid, .detail-grid, .install-form fieldset { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .install-heading { align-items: flex-start; }
    .install-heading .auth-logo { width: 48px; height: 48px; border-radius: 15px; }
    .modal { align-items: flex-end; padding: 0; }
    .modal-panel, .modal-panel.wide { width: 100%; max-height: 93vh; border-radius: 20px 20px 0 0; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar .btn { align-self: flex-start; }
    .data-table th, .data-table td { padding: 10px 11px; }
}
