
/* JVS 811 Tracker v2.4 — UI polish */

:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(23, 50, 77, .06);
    --shadow-md: 0 8px 24px rgba(23, 50, 77, .09);
    --shadow-hover: 0 14px 34px rgba(23, 50, 77, .14);
    --focus-ring: 0 0 0 3px rgba(29, 95, 159, .18);
}

html { scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5; }
main.container { flex: 1 0 auto; width: 100%; }

h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { margin-top: 0; font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { line-height: 1.55; }

.topbar { padding: 0; box-shadow: 0 2px 12px rgba(8, 26, 43, .18); }
.topbar-inner { width: 100%; max-width: 1280px; min-height: 66px; margin: 0 auto; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    white-space: nowrap;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { margin-left: 0; padding: 9px 11px; border-radius: 8px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.88); transition: background .18s ease, color .18s ease; }
.nav a:hover, .nav a:focus-visible, .nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.nav a.active { box-shadow: inset 0 -2px 0 rgba(255,255,255,.8); }
.nav-user { margin-left: 14px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.22); font-size: 13px; font-weight: 400; color: rgba(255,255,255,.72); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .nav-signout { font-weight: 500; color: rgba(255,255,255,.8); }
.menu-toggle { width: 42px; height: 42px; border-radius: 9px; align-items: center; justify-content: center; }
.menu-toggle:hover, .menu-toggle:focus-visible { background: rgba(255,255,255,.12); }

.container { max-width: 1240px; margin: 28px auto; padding: 0 20px; }
.page-heading { margin-bottom: 22px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading p { margin: 5px 0 0; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 13px; font-weight: 700; }

.card { border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); transition: border-color .18s ease, box-shadow .18s ease; }
.card:hover { border-color: #cdd9e3; }
.metric-card, .project-summary-card, .dashboard-kpi { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card:hover, .project-summary-card:hover, .dashboard-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.btn { min-height: 40px; gap: 7px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; line-height: 1.2; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(29,95,159,.18); }
.btn:active { transform: translateY(0); }
.btn.secondary { border-color: #d5dee6; background: #f0f4f7; }
.btn.secondary:hover { background: #e4ebf1; box-shadow: 0 5px 12px rgba(23,50,77,.10); }
.btn.danger { background: var(--red); }
.btn[disabled], .btn:disabled { cursor: wait; opacity: .62; transform: none; box-shadow: none; }
.btn.is-loading::before { content: ''; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: jvs-spin .7s linear infinite; }
@keyframes jvs-spin { to { transform: rotate(360deg); } }

input, select, textarea { min-height: 42px; border-radius: 9px; border-color: #c7d2dc; font: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { min-height: 100px; }
input:hover, select:hover, textarea:hover { border-color: #aabac8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus-ring); }
label { color: #33485b; letter-spacing: .01em; }
.form-grid, .filter-grid { row-gap: 16px; }
.form-actions { margin-top: 18px; }
.permission-check { transition: border-color .15s ease, background .15s ease; }
.permission-check:hover { border-color: #b7c7d4; background: #fbfcfd; }
.permission-check input { accent-color: var(--blue); }

.table-wrap { border: 1px solid var(--border); border-radius: 12px; background: #fff; }
table { background: #fff; }
thead th { position: sticky; top: 0; z-index: 1; background: #f6f8fa; color: #526577; text-transform: uppercase; letter-spacing: .035em; font-size: 11px; }
tbody tr:nth-child(even) { background: #fbfcfd; }
tbody tr:hover { background: #f3f7fa; }
th, td { padding: 13px 12px; }
tbody tr:last-child td { border-bottom: 0; }

.badge { border: 1px solid transparent; line-height: 1.15; letter-spacing: .01em; }
.badge.active { border-color: rgba(25,135,84,.22); }
.badge.action_required, .badge.expired, .badge.failed { border-color: rgba(180,35,24,.18); }
.badge.expiring { border-color: rgba(181,71,8,.20); }
.badge.closed { border-color: rgba(71,84,103,.14); }
.badge.new { background: #eaf2ff; color: #175cd3; border-color: #c7d7fe; }

.alert, .notice, .settings-warning { border-radius: 11px; box-shadow: var(--shadow-sm); }
.alert.success, .notice { border: 1px solid #b7d7c5; background: #ecfdf3; color: #067647; }
.empty-state, .empty-compact { border-radius: 11px; background: #f8fafc; border: 1px dashed #ccd7e0; }

.project-summary-card { border-radius: 13px; }
.project-title { line-height: 1.35; }
.project-stats { margin-top: 3px; }

.settings-section { margin-bottom: 0; }
.settings-grid { align-items: start; }
.settings-section h2 { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.system-action { background: #fff; border-radius: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.system-action:hover { border-color: #b8c8d5; box-shadow: var(--shadow-sm); }
.system-action strong { color: var(--navy); }

.map-panel { overflow: hidden; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 12px 28px rgba(23,50,77,.18); }
.leaflet-popup-content { margin: 15px 16px; }
.map-legend { box-shadow: var(--shadow-sm); }
.legend-row { font-size: 13px; }

.ticket-note { box-shadow: 0 1px 4px rgba(23,50,77,.04); }
.ticket-note-form { border-radius: 12px; }

.site-footer { flex: 0 0 auto; border-top: 1px solid var(--border); background: #eef3f7; color: var(--muted); }
.site-footer-inner { max-width: 1240px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; font-size: 12px; }
.footer-divider { opacity: .55; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 900px) {
    .topbar-inner { min-height: 60px; padding: 0 14px; }
    .nav { position: absolute; top: 58px; right: 12px; left: 12px; display: none; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 16px 32px rgba(0,0,0,.24); }
    .nav.open { display: block; }
    .nav a { display: block; margin: 2px 0; padding: 11px 12px; }
    .nav-user { display: block; max-width: none; margin: 10px 4px 4px; padding: 11px 8px 2px; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
    .menu-toggle { display: inline-flex; }
    .container { margin-top: 22px; }
}

@media (max-width: 600px) {
    .container { padding: 0 12px; }
    .card { padding: 16px; border-radius: 13px; }
    .page-heading { gap: 12px; }
    .page-heading > div:last-child { width: 100%; }
    .page-heading > div:last-child .btn { flex: 1; }
    .btn { min-height: 42px; }
    .site-footer-inner { padding: 16px 12px; }
    .footer-divider { display: none; }
    .site-footer-inner span { width: 100%; text-align: center; }
}

/* Restore normal checkbox/radio sizing */
input[type="checkbox"],
input[type="radio"] {
    width: auto !important;
    height: auto !important;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    cursor: pointer;
}
