:root {
  --navy: #071a3a;
  --navy-2: #0b2a5c;
  --blue: #1b6dff;
  --cyan: #00b7ff;
  --grad: linear-gradient(135deg, #00c2ff 0%, #1b5bff 100%);
  --bg: #f4f6fb;
  --bg-2: #e8edf6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --ink: #071a3a;
  --muted: #5c6b82;
  --line: rgba(7, 26, 58, .1);
  --accent: #1b6dff;
  --accent-2: #00b7ff;
  --ok: #0f7a4a;
  --warn: #b45309;
  --danger: #c01d1d;
  --info: #1b6dff;
  --shadow: 0 10px 32px rgba(7, 26, 58, .07);
  --radius: 16px;
  --sidebar: #071a3a;
  --sidebar-ink: #eef4ff;
  --top: 64px;
  --nav: 260px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #06101f;
  --bg-2: #0b1a33;
  --surface: #0d1b32;
  --surface-2: #102240;
  --ink: #eef4ff;
  --muted: #93a4c0;
  --line: rgba(238, 244, 255, .1);
  --shadow: 0 10px 32px rgba(0, 0, 0, .35);
  --sidebar: #040b18;
  --sidebar-ink: #eef4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video, audio { max-width: 100%; }
h1,h2,h3,h4 { font-weight: 700; margin: 0 0 .35em; letter-spacing: -.03em; }
p { color: var(--muted); margin: 0; }
.muted { color: var(--muted); font-size: 13px; }

/* HTML logo */
.mdt-logo {
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1; color: #071a3a; text-decoration: none;
}
.mdt-logo svg { display: block; flex: 0 0 auto; }
.mdt-word {
  font-weight: 800; letter-spacing: -.045em; font-size: 1.05rem;
  white-space: nowrap;
}
.mdt-di {
  background: linear-gradient(180deg, #5ec8ff 0%, #1b6dff 52%, #00b4ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mdt-logo.light { color: #fff; }
.mdt-logo.light .mdt-di {
  background: linear-gradient(180deg, #8edbff 0%, #3d8aff 55%, #00c2ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mdt-logo.lg .mdt-word { font-size: 1.55rem; }
.mdt-logo.lg svg { width: 34px; height: 34px; }

.app { display: grid; grid-template-columns: var(--nav) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 18px 12px 28px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
  background-image: radial-gradient(420px 220px at 0% 0%, rgba(0,183,255,.22), transparent 60%);
}
.brand { display: flex; flex-direction: column; gap: 10px; padding: 8px 10px 18px; }
.brand .portal-tag {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: #8ecbff; font-weight: 700;
}
.nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #7f93b3; padding: 16px 12px 8px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: #c9d7ea; margin-bottom: 2px; font-weight: 500; font-size: 14px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { box-shadow: inset 3px 0 0 #00b7ff; }
.nav .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #00b7ff; color: #071a3a; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center;
}

.main { min-width: 0; }
.topbar {
  height: var(--top); display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.search-btn, .icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 8px 12px; cursor: pointer;
}
.top-actions { display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 26px; max-width: 1440px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat .v { font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; color: var(--ink); }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat.accent { background: var(--navy); color: #fff; border: 0; }
.stat.accent .k, .stat.accent .s { color: #8ecbff; }
.stat.accent .v { color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 11px;
  padding: 10px 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn-navy { background: var(--navy); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); color: #fff; border: 0; }
.btn-sm { padding: 7px 10px; font-size: 13px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--bg); }
.table a { font-weight: 650; color: var(--navy-2); }
[data-theme="dark"] .table a { color: #8ecbff; }

.badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #e8edf6; color: #475569; }
[data-theme="dark"] .badge-ok { background: #163528; color: #b6f0d0; }
[data-theme="dark"] .badge-danger { background: #3a1613; color: #ffc7c0; }
[data-theme="dark"] .badge-warn { background: #3a2a12; color: #ffd7a1; }
[data-theme="dark"] .badge-info { background: #12243a; color: #c5dcff; }
[data-theme="dark"] .badge-muted { background: #1a2740; color: #c5d0e3; }

.prio { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.prio-urgent { color: var(--danger); }
.prio-high { color: var(--warn); }
.prio-medium { color: var(--info); }
.prio-low { color: var(--muted); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: hsl(var(--h, 210) 70% 42%); color: #fff; font-weight: 700; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }

.form { display: grid; gap: 12px; }
label { font-size: 12px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
}
textarea { min-height: 110px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: #dcfce7; color: #166534; }
.flash-danger { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }
.flash-warn { background: #fef3c7; color: #92400e; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-icon { font-size: 28px; margin-bottom: 8px; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 12px; overflow: auto; padding-bottom: 12px; }
.kanban-col { background: var(--bg-2); border-radius: 16px; padding: 10px; min-height: 420px; }
.kanban-col h4 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px; }
.k-card { background: var(--surface-2); border-radius: 14px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: grab; }
.k-card small { color: var(--muted); }

.thread { display: grid; gap: 12px; }
.bubble { padding: 12px 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.bubble.internal { background: #fff7ed; border-style: dashed; }
[data-theme="dark"] .bubble.internal { background: #2a2418; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.media-card img, .media-card video { display: block; width: 100%; height: 140px; object-fit: cover; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(980px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; background: var(--surface-2); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-art { background: #14110e; color: #f6f1e8; padding: 48px; }
.login-art h1 { font-size: 2.4rem; }
.login-form { padding: 48px; }
.demo-accounts { font-size: 12px; color: var(--muted); display: grid; gap: 4px; margin-top: 18px; }

.bell { position: relative; }
.dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--cyan); border-radius: 50%; }
.dropdown { position: absolute; right: 0; top: 48px; width: 360px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: none; overflow: hidden; z-index: 30; }
.dropdown.open { display: block; }
.dropdown a, .dropdown .item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dropdown .item.unread { background: color-mix(in srgb, var(--cyan) 10%, transparent); }

.modal { position: fixed; inset: 0; background: rgba(7,26,58,.45); display: none; place-items: start center; padding-top: 12vh; z-index: 40; }
.modal.open { display: grid; }
.modal-card { width: min(640px, 92vw); background: var(--surface-2); border-radius: 20px; padding: 18px; }
.search-results { display: grid; gap: 4px; margin-top: 12px; }
.search-results a { padding: 10px; border-radius: 10px; }
.search-results a:hover { background: var(--bg-2); }

.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs a .count { margin-left: 6px; opacity: .75; }

.notice-banner {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--navy); color: #fff; border-radius: 14px; margin-bottom: 16px;
}
.notice-banner.show { display: flex; }

.rec-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.rec-preview { margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }

.work-list { display: grid; gap: 0; }
.work-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.work-row strong { display: block; }
.work-row .meta { font-size: 12px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { width: auto; min-width: 140px; padding: 7px 10px; }

.hero-cta {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 18px;
  background-image: radial-gradient(500px 180px at 100% 0%, rgba(0,183,255,.35), transparent 55%);
}
.hero-cta h2 { margin: 0; font-size: 1.35rem; }
.hero-cta p { color: #c9d7ea; margin-top: 6px; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .login-card { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .work-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; transform: translateX(-110%); width: min(280px, 86vw); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .g-4, .g-3, .g-2, .row-2, .row-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}
