/* Directory — portal styles. Asset College brand kit (Standards 07). */

:root {
  /* Brand */
  --blue-bright: #20c4f4;
  --blue-mid:    #008dd2;
  --blue-pale:   #E6F6FD;
  /* Ink */
  --ink:         #1A1A1A;
  --ink-soft:    #4A5568;
  --ink-muted:   #8A9BB0;
  /* Surfaces */
  --surface:     #FFFFFF;
  --surface-2:   #F0F8FD;
  --border:      #C8E8F8;
  /* Sizing */
  --sidebar-w:   220px;
  --radius:      8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'DM Sans', sans-serif; }
input, select, textarea, button { font-family: inherit; }

body {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-bright); }

/* ---- Layout shell ---- */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #0d1117;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-logo { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo img { max-width: 150px; height: auto; display: block; }
.sidebar-logo-fallback { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.sidebar-logo-fallback span { color: var(--blue-bright); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 14px; }
.nav-section {
  padding: 14px 0 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.35);
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 6px;
  color: rgba(255,255,255,.45); font-size: 13px; font-weight: 400; text-decoration: none;
  cursor: pointer; transition: background .15s, color .15s; border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.75); }
.nav-item.active {
  background: rgba(0,141,210,.25); color: #fff; font-weight: 500;
  border-left: 2px solid var(--blue-bright); padding-left: 10px;
}
.nav-icon { width: 15px; height: 15px; opacity: .6; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue-mid); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: 12.5px; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 10.5px; color: rgba(255,255,255,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Title bar ---- */
.title-bar {
  background: linear-gradient(105deg, #0a1628 0%, #1d3461 100%);
  border-bottom: 2px solid #20C4F4; padding: 18px 36px; min-height: 110px;
  box-sizing: border-box; display: flex; align-items: center; gap: 22px;
  flex-shrink: 0; position: sticky; top: 0; z-index: 10;
}
.title-bar-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(32,196,244,.12);
  border: 1.5px solid rgba(32,196,244,.35); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; box-shadow: 0 0 24px rgba(32,196,244,.15);
}
.title-bar-icon { width: 30px; height: 30px; color: #fff; }
.title-bar-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.title-bar-name { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.015em; line-height: 1.15; }
.title-bar-tags {
  font-size: 11px; font-weight: 600; color: #20C4F4; letter-spacing: .2em;
  text-transform: uppercase; display: flex; align-items: center; gap: 10px;
}
.title-bar-tag-sep { opacity: .45; }

/* ---- Page header ---- */
.page-header {
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.page-header h1 { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.page-subtitle { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }

/* ---- Panels ---- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 20px 28px 0; flex-shrink: 0;
}
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 10px; background: linear-gradient(135deg, var(--blue-pale) 0%, var(--surface) 70%);
}
.panel-head-icon {
  width: 30px; height: 30px; background: var(--blue-mid); border-radius: 6px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: #fff;
}
.panel-head h2 { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.panel-head p { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.panel-body { padding: 18px; }

/* ---- Overview stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--surface) 80%);
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--blue-mid); letter-spacing: -.02em; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin-top: 2px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  padding: 9px 14px; text-align: left; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted);
  background: #f7fbfe; border-bottom: 1px solid var(--border);
}
.data-table tbody tr { border-bottom: 1px solid #eef5fb; transition: background .1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f0f9ff; }
.data-table td { padding: 9px 14px; color: var(--ink-soft); vertical-align: middle; }
.td-name { font-weight: 500; color: var(--ink) !important; }
.td-id { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--ink-muted) !important; }
.empty-state { padding: 32px; text-align: center; color: var(--ink-muted); font-size: 13px; }

/* ---- Forms ---- */
.field-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group.flex-1 { flex: 1; min-width: 160px; }
.field-label { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.optional { font-weight: 400; color: var(--ink-muted); text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.required { color: #ef4444; }
.field-input {
  height: 38px; padding: 0 11px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13.5px; color: var(--ink); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field-input:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(32,196,244,.15); }
.field-input::placeholder { color: var(--ink-muted); }
select.field-input { appearance: auto; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 20px;
  background: var(--blue-mid); color: #fff; border: none; border-radius: 6px;
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn-primary:hover { background: #006fab; }
.btn-primary:disabled { background: var(--border); color: var(--ink-muted); cursor: default; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px;
  background: transparent; color: var(--ink-soft); border: 1.5px solid var(--border);
  border-radius: 6px; font-weight: 500; font-size: 12.5px; cursor: pointer; transition: .15s;
}
.btn-ghost:hover { background: var(--blue-pale); color: var(--blue-mid); border-color: var(--blue-bright); }
.btn-discard {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  background: transparent; color: #dc2626; border: 1.5px solid #fecaca; border-radius: 6px;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn-discard:hover { background: #fef2f2; }

/* ---- Badges / chips ---- */
.status-badge { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }
.status-badge.active  { background: #dcfce7; color: #166534; }
.status-badge.merged  { background: #fef3c7; color: #92400e; }
.status-badge.archived{ background: #fee2e2; color: #991b1b; }
.status-badge.success { background: #dcfce7; color: #166534; }
.status-badge.failure { background: #fee2e2; color: #991b1b; }
.status-badge.info    { background: var(--blue-pale); color: var(--blue-mid); }
.count-pill { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--blue-mid); background: #cceeff; padding: 3px 9px; border-radius: 10px; }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; flex-shrink: 0; }
.page-btn {
  height: 30px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink-soft); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--blue-bright); color: var(--blue-mid); background: var(--blue-pale); }
.page-btn:disabled { opacity: .5; cursor: default; }
.page-info { font-size: 12.5px; color: var(--ink-muted); }
.page-info b { color: var(--ink); font-weight: 600; }
.page-sep { margin: 0 6px; opacity: .5; }

/* ---- Footer ---- */
.page-footer {
  padding: 12px 28px; font-size: 12px; color: #9CA3AF; background: #fff;
  border-top: 1px solid #E5E7EB; text-align: center; flex-shrink: 0; margin-top: auto;
}
.page-footer a { color: inherit; text-decoration: none; transition: color .15s; cursor: pointer; }
.page-footer a:hover { color: var(--blue-mid); text-decoration: underline; }
.footer-divider { margin: 0 8px; opacity: .5; }

/* ---- Toasts ---- */
.toast-container { position: fixed; bottom: 70px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 7px;
  font-size: 13px; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: toastIn .2s ease; max-width: 320px;
}
.toast.success { background: #166534; }
.toast.error { background: #991b1b; }
.toast.info { background: var(--blue-mid); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.view { display: none; }
.view.active { display: block; }
.note { font-size: 12.5px; color: var(--ink-muted); margin: 12px 28px 0; }
