/* Know-Vera Portal Base Styles */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface-2: #1e2333;
  --border: #2a3045;
  --accent: #4f8ef7;
  --accent-dim: #2a3f6f;
  --text: #e8eaf0;
  --text-muted: #7a8098;
  --text-dim: #4a5068;
  --success: #3ecf8e;
  --warning: #f5a623;
  --danger: #f06060;
  --radius: 10px;
  --radius-sm: 6px;
}

.impersonation-banner {
  background: #f5a623;
  color: #1a1000;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 200;
}

.impersonation-banner a {
  color: #1a1000;
  text-decoration: underline;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  opacity: 0.8;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 8px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 400;
  transition: all 0.15s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-2);
  color: var(--text);
  opacity: 1;
}

.nav-link.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
  padding: 2px;
  display: flex;
  align-items: center;
}

.logout-btn:hover {
  color: var(--danger);
}

/* Main content */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-header h1 {
  font-size: 34px;
  line-height: 1.1;
  margin-top: 10px;
  color: var(--text);
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero-copy {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 680px;
}

.hero-actions {
  display: flex;
  align-items: center;
}

.hero-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.hero-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.hero-note p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 600px;
  margin: 0;
}

.callout {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.callout-info {
  background: rgba(79, 142, 247, 0.08);
  border: 1px solid rgba(79, 142, 247, 0.2);
  color: var(--text);
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tab:hover,
.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.asset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 142, 247, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.asset-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(79, 142, 247, 0.12);
  font-size: 22px;
}

.asset-content h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.asset-content p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 14px;
}

.asset-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.asset-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.asset-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.section-description {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 680px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  min-height: 36px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #6a9ef8;
  opacity: 1;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  opacity: 1;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  min-height: auto;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--surface-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-admin {
  background: rgba(79, 142, 247, 0.15);
  color: var(--accent);
}

.badge-staff {
  background: rgba(62, 207, 142, 0.12);
  color: var(--success);
}

.badge-video {
  background: rgba(245, 166, 35, 0.12);
  color: var(--warning);
}

.badge-document {
  background: rgba(79, 142, 247, 0.12);
  color: var(--accent);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=search],
textarea,
select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
  min-height: 36px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

select option {
  background: var(--surface-2);
}

input[type=file] {
  width: 100%;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  min-height: auto;
}

.errorlist {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  list-style: none;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid rgba(62, 207, 142, 0.25);
  color: var(--success);
}

.alert-error {
  background: rgba(240, 96, 96, 0.1);
  border: 1px solid rgba(240, 96, 96, 0.25);
  color: var(--danger);
}

/* Search */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
}

/* Filter row */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-row select {
  width: auto;
  min-width: 160px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13.5px;
  margin-bottom: 16px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Mobile hamburger menu */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 24px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
}

.hamburger-btn:hover {
  color: var(--text);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 24px;
  padding: 8px;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn:hover {
  color: var(--text);
}
