:root {
  --ink-900: #0B1220; --ink-800: #101A2E; --paper: #F4F6F9; --card: #FFFFFF; --line: #E4E8EF;
  --text-primary: #1A2233; --text-muted: #64708A; --teal: #0E7C7B; --teal-dark: #0A5F5E; --teal-soft: #E4F3F2;
  --amber: #C98A2C; --amber-soft: #FBF0DD; --red: #C1483F; --red-soft: #FBEAE8; --green: #2E8B57; --green-soft: #E6F4EC;
  --radius: 10px; --sidebar-w: 254px;
  --nav-text: #A9B4CC; --nav-text-hover: #FFFFFF; --nav-text-active: #FFFFFF; --nav-icon: #6E7C9C;
  --nav-icon-active: #35D6C8; --nav-active-bg: #123331; --nav-hover-bg: rgba(255,255,255,0.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--paper); color: var(--text-primary); margin: 0; -webkit-font-smoothing: antialiased; font-size: 14.5px; line-height: 1.5; }
h1, h2, h3, h4, .display { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
a { text-decoration: none; color: inherit; }
p { margin: 0 0 10px; }

.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--ink-900); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; height: 100%; overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.06); z-index: 40; }
.sidebar-brand { padding: 22px 22px 20px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 18px; color: #FFFFFF; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sidebar-brand .mark { width: 32px; height: 32px; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; font-weight: 800; flex-shrink: 0; }
.sidebar-nav { flex: 1 0 auto; padding-bottom: 12px; background: var(--ink-900); }
.sidebar-section-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: #4C5875; padding: 20px 22px 8px; }
.sidebar-nav > .sidebar-section-label:first-child { padding-top: 6px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 22px; margin: 1px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--nav-text); transition: background 0.12s ease, color 0.12s ease; }
.sidebar-link .nav-icon { color: var(--nav-icon); flex-shrink: 0; transition: color 0.12s ease; }
.sidebar-link:hover { background: var(--nav-hover-bg); color: var(--nav-text-hover); }
.sidebar-link:hover .nav-icon { color: var(--nav-text-hover); }
.sidebar-link.active { background: var(--nav-active-bg); color: var(--nav-text-active); font-weight: 600; }
.sidebar-link.active .nav-icon { color: var(--nav-icon-active); }
.sidebar-footer { padding: 14px 22px 18px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; background: var(--ink-900); }
.sidebar-logout { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: #E4A2A2; padding: 8px 4px; }
.sidebar-logout .nav-icon { color: #E4A2A2; }
.sidebar-logout:hover { color: #F5C4C0; }
.sidebar-logout:hover .nav-icon { color: #F5C4C0; }

.main { min-height: 100vh; display: flex; flex-direction: column; margin-left: var(--sidebar-w); }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 18px 30px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.topbar h1 { font-size: 21px; margin: 0; line-height: 1.2; }
.topbar .subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.user-chip { display: flex; align-items: center; gap: 11px; font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.content { padding: 28px 30px; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 22px; position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-card .stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 27px; font-weight: 800; margin-top: 6px; }
.stat-card .stat-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.bar-teal { background: var(--teal); } .bar-amber { background: var(--amber); } .bar-red { background: var(--red); } .bar-green { background: var(--green); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 17px; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; border: 1px solid transparent; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #F6D8D4; }
.btn-sm { padding: 6px 13px; font-size: 13px; }

.form-group { margin-bottom: 17px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.form-control { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text-primary); }
.form-control:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 11px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #FAFBFD; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gray { background: #EEF1F6; color: var(--text-muted); }

.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kanban-col { background: #EEF1F6; border-radius: var(--radius); padding: 14px; min-height: 320px; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 12px; display: flex; justify-content: space-between; padding: 0 2px; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 13px; margin-bottom: 10px; font-size: 13.5px; }
.kanban-card .title { font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.kanban-card .title a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.kanban-card .title a:hover { text-decoration-color: var(--teal); }
.kanban-card .meta { font-size: 12px; color: var(--text-muted); }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(circle at 20% 15%, #123331 0%, var(--ink-900) 55%), var(--ink-900); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.06); top: -140px; right: -160px; }
.auth-side::after { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.05); bottom: -120px; left: -100px; }
.auth-side-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-side-brand .mark { width: 40px; height: 40px; background: linear-gradient(135deg, var(--teal), #14A39C); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.auth-side-brand .name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 20px; }
.auth-side-copy { position: relative; z-index: 1; max-width: 380px; }
.auth-side-copy h2 { color: #fff; font-size: 30px; line-height: 1.25; margin-bottom: 14px; }
.auth-side-copy p { color: #A9B4CC; font-size: 15px; line-height: 1.6; }
.auth-side-foot { position: relative; z-index: 1; color: #5C6B87; font-size: 12.5px; }
.auth-form-side { display: flex; align-items: center; justify-content: center; background: var(--paper); padding: 48px 24px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 52px 46px; width: 100%; max-width: 460px; box-shadow: 0 16px 40px rgba(15,23,42,0.08); }
.auth-card h2 { font-size: 26px; margin: 0 0 6px; }
.auth-card .auth-sub { color: var(--text-muted); font-size: 14.5px; margin-bottom: 30px; }

@media (max-width: 700px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card { padding: 36px 26px; border-radius: 14px; box-shadow: none; border: none; }
}
@media (max-width: 860px) {
  .sidebar { left: -270px; transition: left .2s; box-shadow: 8px 0 24px rgba(0,0,0,0.25); }
  .sidebar.open { left: 0; }
  .main { margin-left: 0; }
  .kanban { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .topbar { padding: 14px 18px; }
}
