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

:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --btn-bg: rgba(255, 255, 255, 0.10);
  --btn-hover: rgba(255, 255, 255, 0.40);
  --notif-bg: rgba(255, 255, 255, 0.20);
  --clock-bg: rgba(255, 255, 255, 0.20);
  --dock-bg: rgba(255, 255, 255, 0.12);
  --panel-bg: rgba(10, 26, 56, 0.42);
  --border: rgba(255, 255, 255, 0.14);
  --active: #59c3ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

html, body {
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: #071122;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top left, rgba(20, 55, 110, 0.45), transparent 32%),
    radial-gradient(circle at top right, rgba(16, 83, 145, 0.35), transparent 30%),
    linear-gradient(135deg, rgba(5, 13, 26, 0.76), rgba(8, 22, 46, 0.74), rgba(12, 40, 78, 0.70));
  backdrop-filter: blur(1px);
}

.topbar {
  width: 100%;
  padding: 18px 30px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  --tb-opacity: 0;
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.14)
  );
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  opacity: var(--tb-opacity);
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.topbar-right {
  justify-content: flex-end;
}

.topbar-center {
  display: flex;
  justify-content: center;
}

/* Logo */
.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-logo img {
  height: 38px;
  border-radius: 12px;
  object-fit: contain;
  transition: opacity 0.5s ease;
}
body.zen-mode .topbar-logo img {
  opacity: 0.20;
}

/* Dock items */
.dock-item {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, background 0.20s ease, border-color 0.20s ease, box-shadow 0.20s ease;
}

.dock-item:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.dock-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.dock-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

/* Logout button */
.btn-logout {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(244,67,54,0.15);
  border: 1px solid rgba(244,67,54,0.25);
  color: #ef5350;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, background 0.20s ease, border-color 0.20s ease;
}

.btn-logout:hover {
  background: rgba(244,67,54,0.30);
  border-color: rgba(244,67,54,0.45);
  transform: translateY(-1px);
}

.clock-box {
  min-width: 120px;
  height: 54px;
  border-radius: 16px;
  background: var(--clock-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.18);
}

.clock-colon {
  display: inline-block;
  width: 12px;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.clock-colon.blink-off {
  opacity: 0.2;
}

/* ===== PROFILE/CLOCK 3D CUBE ===== */
.pc-cube-wrap {
  width: 120px;
  height: 54px;
  perspective: 400px;
}
.pc-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.pc-cube.no-transition {
  transition: none !important;
}
.pc-cube.flipped {
  transform: rotateX(-90deg);
}
.pc-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: var(--clock-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.18);
}
.pc-face-clock {
  transform: rotateX(0deg) translateZ(27px);
  gap: 4px;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
}
.pc-face-profile {
  transform: rotateX(90deg) translateZ(27px);
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.pc-face-profile:hover {
  background: rgba(255,255,255,0.28);
}
.pc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(89,195,255,0.2); color: var(--active);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  border: 1.5px solid rgba(89,195,255,0.3); overflow: hidden;
}
.pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-role {
  font-size: 11px; font-weight: 600; color: #fff;
  white-space: nowrap;
}

/* ===== PROFILE MODAL ===== */
.prof-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  z-index: 9999; align-items: center; justify-content: center;
}
.prof-overlay.active { display: flex; }
.prof-box {
  width: min(94%, 420px); padding: 28px 24px; border-radius: 22px;
  background: rgba(10,26,56,0.95); border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  max-height: 90vh; overflow-y: auto;
}
.prof-box::-webkit-scrollbar { width: 4px; }
.prof-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.prof-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.prof-header h3 { font-size: 18px; margin: 0; color: #fff; }
.prof-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(239,83,80,0.12); border: 1px solid rgba(239,83,80,0.25);
  color: #ef5350; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: transform 0.2s, background 0.2s;
}
.prof-close:hover { transform: scale(1.1); background: rgba(239,83,80,0.25); }
.prof-photo-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 20px; position: relative;
}
.prof-photo {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(89,195,255,0.15); color: var(--active);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  border: 2px solid rgba(89,195,255,0.3); overflow: hidden;
}
.prof-photo img { width: 100%; height: 100%; object-fit: cover; }
.prof-photo-btn {
  position: absolute; bottom: 0; right: calc(50% - 52px);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(89,195,255,0.2); border: 1px solid rgba(89,195,255,0.3);
  color: var(--active); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.prof-photo-btn:hover { background: rgba(89,195,255,0.4); }
.prof-fields { display: flex; flex-direction: column; gap: 10px; }
.prof-field label {
  display: block; font-size: 12px; color: rgba(255,255,255,0.5);
  margin-bottom: 4px; font-weight: 600;
}
.prof-field input,
.prof-field textarea {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 14px; outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.prof-field input:focus,
.prof-field textarea:focus { border-color: var(--active); }
.prof-field textarea { resize: vertical; min-height: 50px; }
.prof-actions {
  display: flex; gap: 10px; margin-top: 18px;
}
.prof-btn {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.prof-btn.cancel {
  background: rgba(255,255,255,0.06); color: #fff;
}
.prof-btn.cancel:hover { background: rgba(255,255,255,0.12); }
.prof-btn.save {
  background: rgba(89,195,255,0.15); border-color: rgba(89,195,255,0.25);
  color: var(--active);
}
.prof-btn.save:hover { background: rgba(89,195,255,0.3); }
.prof-msg {
  text-align: center; font-size: 13px; margin-top: 10px; min-height: 18px;
}

@media (max-width: 1180px) {
  .pc-cube-wrap { width: 100px; height: 46px; }
  .pc-face-clock { font-size: 24px; transform: rotateX(0deg) translateZ(23px); }
  .pc-face-profile { transform: rotateX(90deg) translateZ(23px); }
  .pc-avatar { width: 28px; height: 28px; font-size: 11px; }
  .pc-role { font-size: 10px; }
}
@media (max-width: 960px) {
  .pc-cube-wrap { display: none; }
}

.dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 18px;
  border-radius: 24px;
  background: var(--dock-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--shadow);
  position: relative;
}

.dock-item.active {
  background: rgba(255,255,255,0.40);
  border-color: rgba(89, 195, 255, 0.26);
}

.dock-item:hover svg {
  transform: scale(1.06);
}

.tooltip {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(18, 18, 28, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  visibility: hidden;
  transition: 0.18s ease;
}

.dock-item:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.indicator {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%) scale(0.8);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 12px rgba(89, 195, 255, 0.85);
  opacity: 0;
  transition: 0.18s ease;
}

.dock-item.active .indicator {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.app {
  min-height: 100vh;
  padding: 170px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: min(100%, 1100px);
  text-align: center;
  margin-bottom: 35px;
}

.hero h1 {
  font-size: clamp(44px, 5vw, 72px);
  margin-bottom: 14px;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hero p {
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.content-box {
  width: min(100%, 1100px);
  min-height: 280px;
  padding: 40px;
  border-radius: 30px;
  background: var(--panel-bg);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.content-box h2 {
  font-size: clamp(34px, 4vw, 54px);
  margin-bottom: 16px;
}

.content-box p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  max-width: 760px;
  margin: 0 auto;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--muted);
  font-size: 14px;
}

/* ======================== TABLET: 769px — 1180px ======================== */
@media (max-width: 1180px) {
  .topbar {
    padding: 12px 16px;
    gap: 10px;
  }

  .dock-item {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .dock-item svg {
    width: 20px;
    height: 20px;
  }

  .dock-icon-img {
    width: 24px;
    height: 24px;
  }

  .dock {
    gap: 6px;
    padding: 10px 12px 14px;
  }

  .clock-box {
    min-width: 100px;
    height: 46px;
    font-size: 24px;
  }

  .btn-logout {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .topbar-logo img {
    height: 46px;
  }
}

/* Clock hides when viewport is tight */
@media (max-width: 960px) {
  .clock-box {
    display: none;
  }
}

/* ======================== LOGIN PAGE ======================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  width: min(100%, 440px);
  padding: 28px 36px;
  border-radius: 30px;
  background: var(--panel-bg);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card .login-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: contain;
  margin-bottom: 12px;
}

.login-card h2 {
  font-size: 28px;
  margin-bottom: 4px;
}

.login-card .login-subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus {
  border-color: var(--active);
  background: rgba(255,255,255,0.12);
}

.form-group input::placeholder {
  color: rgba(255,255,255,0.35);
}

.login-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #3a8fd4, #59c3ff);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(89, 195, 255, 0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(89, 195, 255, 0.45);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  background: rgba(255, 77, 104, 0.15);
  border: 1px solid rgba(255, 77, 104, 0.3);
  color: #ff6b82;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
}

.login-back {
  display: inline-block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-back:hover {
  color: #fff;
}

/* ======================== PORTAL PAGE ======================== */
.portal-wrapper {
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-header {
  text-align: center;
  margin-bottom: 50px;
}

.portal-logo {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  object-fit: contain;
  margin-bottom: 20px;
}

.portal-header h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 10px;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.portal-header p {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.dept-grid {
  width: min(100%, 1200px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.dept-card {
  padding: 32px 24px;
  border-radius: 24px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.dept-card:hover {
  transform: translateY(-6px);
  background: rgba(20, 45, 90, 0.55);
  border-color: rgba(89, 195, 255, 0.3);
}

.dept-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.dept-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.dept-icon.ministry { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.dept-icon.hr { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
.dept-icon.call-center { background: rgba(33, 150, 243, 0.2); color: #2196f3; }
.dept-icon.consultant { background: rgba(156, 39, 176, 0.2); color: #ce93d8; }
.dept-icon.negotiator { background: rgba(255, 152, 0, 0.2); color: #ff9800; }
.dept-icon.negotiation { background: rgba(255, 87, 34, 0.2); color: #ff7043; }
.dept-icon.intelligence { background: rgba(244, 67, 54, 0.2); color: #ef5350; }
.dept-icon.spy-dept { background: rgba(96, 125, 139, 0.2); color: #90a4ae; }
.dept-icon.damu-crm { background: rgba(0, 188, 212, 0.2); color: #00bcd4; }
.dept-icon.damu-student { background: rgba(103, 58, 183, 0.2); color: #9c6fe4; }
.dept-icon.apply { background: rgba(46, 213, 115, 0.2); color: #2ed573; }

.dept-badge.public { background: rgba(46, 213, 115, 0.2); color: #2ed573; }

.dept-card--public {
  border-color: rgba(46, 213, 115, 0.2);
}
.dept-card--public:hover {
  border-color: rgba(46, 213, 115, 0.4);
  background: rgba(10, 40, 20, 0.55);
}

.dept-card h3 {
  font-size: 18px;
  font-weight: 600;
}

.dept-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.dept-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dept-badge.top { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.dept-badge.main { background: rgba(89, 195, 255, 0.2); color: var(--active); }
.dept-badge.sub { background: rgba(255,255,255,0.1); color: var(--muted); }

/* ======================== DASHBOARD BASE ======================== */
.dashboard {
  min-height: 100vh;
  padding: 110px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-header {
  width: min(100%, 1200px);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.dash-header .dept-icon {
  width: 56px;
  height: 56px;
}

.dash-header h1 {
  font-size: clamp(24px, 3vw, 36px);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dash-header p {
  color: var(--muted);
  font-size: 15px;
}

.dash-stats {
  width: min(100%, 1200px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 24px;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
}

.stat-card .stat-change {
  font-size: 13px;
  margin-top: 6px;
}

.stat-change.up { color: #4caf50; }
.stat-change.down { color: #ff4d68; }

.dash-content {
  width: min(100%, 1200px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dash-panel {
  padding: 28px;
  border-radius: 24px;
  background: var(--panel-bg);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.dash-panel.full {
  grid-column: 1 / -1;
}

.dash-panel h3 {
  font-size: 18px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Table scroll wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table styles */
.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th,
.dash-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dash-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-table tr:hover td {
  background: rgba(255,255,255,0.04);
}

/* Status badges */
.status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status.online { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
.status.offline { background: rgba(255,255,255,0.1); color: var(--muted); }
.status.busy { background: rgba(255, 152, 0, 0.2); color: #ff9800; }
.status.new { background: rgba(33, 150, 243, 0.2); color: #2196f3; }
.status.pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.status.done { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
.status.rejected { background: rgba(244, 67, 54, 0.2); color: #ef5350; }

/* List items */
.dash-list {
  list-style: none;
}

.dash-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.dash-list li:last-child {
  border-bottom: none;
}

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(89, 195, 255, 0.2);
  color: var(--active);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Action buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.action-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: linear-gradient(135deg, #3a8fd4, #59c3ff);
  border-color: transparent;
}

.action-btn.danger {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.3);
  color: #ef5350;
}

/* ======================== SMALL TABLET: < 900px ======================== */
@media (max-width: 900px) {
  .dash-content {
    grid-template-columns: 1fr;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dept-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .dash-panel {
    padding: 20px;
  }

  .dash-table th,
  .dash-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ======================== MOBILE: < 768px ======================== */
@media (max-width: 768px) {

  /* --- TOPBAR: 2-row mobile layout --- */
  /* Row 1: logo (left) + logout (right) */
  /* Row 2: dock (full width, centered) */
  .topbar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 10px 12px;
    gap: 8px;
    align-items: center;
    background: rgba(5, 13, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .topbar-left {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    padding: 0;
  }

  .topbar-right {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    padding: 0;
  }

  .topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  .clock-box {
    display: none;
  }

  .topbar-logo img {
    height: 40px;
    border-radius: 10px;
  }

  .btn-logout {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .btn-logout svg {
    width: 18px;
    height: 18px;
  }

  .dock-item {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .dock-item svg {
    width: 20px;
    height: 20px;
  }

  .dock-icon-img {
    width: 22px;
    height: 22px;
  }

  .dock {
    gap: 6px;
    padding: 8px 10px 12px;
    border-radius: 16px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    justify-content: center;
  }

  .dock::-webkit-scrollbar {
    display: none;
  }

  .tooltip {
    display: none;
  }

  .indicator {
    bottom: -8px;
    width: 6px;
    height: 6px;
  }

  /* --- PORTAL PAGE mobile --- */
  .portal-wrapper {
    padding: 30px 14px;
  }

  .portal-header {
    margin-bottom: 28px;
  }

  .portal-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .portal-header h1 {
    font-size: 28px;
  }

  .portal-header p {
    font-size: 14px;
  }

  .dept-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dept-card {
    flex-direction: row;
    text-align: left;
    padding: 18px 16px;
    border-radius: 18px;
    gap: 14px;
  }

  .dept-card .dept-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .dept-card .dept-icon svg {
    width: 26px;
    height: 26px;
  }

  .dept-card h3 {
    font-size: 16px;
  }

  .dept-card p {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dept-badge {
    font-size: 10px;
    padding: 3px 8px;
    align-self: flex-start;
  }

  /* --- LOGIN PAGE mobile --- */
  .login-wrapper {
    padding: 20px 14px;
    align-items: flex-start;
    padding-top: 60px;
  }

  .login-card {
    padding: 32px 20px;
    border-radius: 22px;
  }

  .login-card .login-logo {
    width: 60px;
    height: 60px;
  }

  .login-card h2 {
    font-size: 22px;
  }

  .login-card .login-subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .form-group input {
    height: 46px;
    font-size: 15px;
    border-radius: 12px;
  }

  .login-btn {
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* --- DASHBOARD mobile --- */
  .dashboard {
    padding: 130px 12px 30px;
  }

  .dash-header {
    gap: 14px;
    margin-bottom: 20px;
  }

  .dash-header .dept-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .dash-header .dept-icon svg {
    width: 22px;
    height: 22px;
  }

  .dash-header h1 {
    font-size: 20px;
  }

  .dash-header p {
    font-size: 13px;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 16px;
    border-radius: 16px;
  }

  .stat-card .stat-label {
    font-size: 11px;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  .stat-card .stat-change {
    font-size: 11px;
  }

  .dash-content {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dash-panel {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .dash-panel h3 {
    font-size: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  /* --- TABLES: horizontal scroll on mobile --- */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -14px;
    padding: 0 14px;
  }

  .table-scroll::-webkit-scrollbar {
    display: none;
  }

  .dash-table {
    min-width: 500px;
  }

  .dash-table th,
  .dash-table td {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .dash-table th {
    font-size: 11px;
  }

  /* --- LISTS mobile --- */
  .dash-list li {
    padding: 10px 0;
    gap: 8px;
    font-size: 13px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* --- ACTION BUTTONS mobile --- */
  .action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  .action-btn.primary {
    padding: 6px 12px;
  }

  /* --- STATUS BADGES mobile --- */
  .status {
    padding: 3px 8px;
    font-size: 11px;
  }

  /* --- APP old page --- */
  .app {
    padding-top: 160px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .content-box {
    padding: 24px 16px;
    border-radius: 20px;
    min-height: 200px;
  }

  .content-box h2 {
    font-size: 24px;
  }

  .content-box p {
    font-size: 15px;
  }
}

/* ======================== EXTRA SMALL MOBILE: < 400px ======================== */
@media (max-width: 400px) {
  .topbar {
    padding: 8px 8px;
  }

  .topbar-center {
    overflow-x: auto;
  }

  .dock {
    gap: 4px;
    padding: 6px 8px 10px;
  }

  .dock-item {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .dock-item svg {
    width: 18px;
    height: 18px;
  }

  .dock-icon-img {
    width: 20px;
    height: 20px;
  }

  .topbar-logo img {
    height: 34px;
  }

  .btn-logout {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .btn-logout svg {
    width: 16px;
    height: 16px;
  }

  .portal-header h1 {
    font-size: 24px;
  }

  .dept-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .dept-card .dept-icon {
    width: 42px;
    height: 42px;
  }

  .dept-card .dept-icon svg {
    width: 22px;
    height: 22px;
  }

  .dept-card h3 {
    font-size: 14px;
  }

  .dashboard {
    padding: 120px 8px 24px;
  }

  .dash-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card .stat-value {
    font-size: 20px;
  }

  .dash-panel {
    padding: 14px 10px;
    border-radius: 14px;
  }

  .dash-header h1 {
    font-size: 18px;
  }

  .login-card {
    padding: 24px 16px;
    border-radius: 18px;
  }

  .login-card h2 {
    font-size: 20px;
  }
}

/* ===== CONSULTANT SEARCH OVERLAY ===== */
.con-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.con-search-overlay.active {
  display: flex;
}
.con-search-box {
  width: min(94%, 560px);
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: conSearchIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes conSearchIn {
  0% { opacity: 0; transform: scale(0.85) translateY(-20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.con-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.con-search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
}
.con-search-input-wrap input::placeholder {
  color: rgba(255,255,255,0.35);
}
.con-search-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(239,83,80,0.12);
  border: none;
  color: #ef5350;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.con-search-close:hover {
  background: rgba(239,83,80,0.25);
}
.con-search-results {
  max-height: 50vh;
  overflow-y: auto;
}
.con-search-results::-webkit-scrollbar { width: 5px; }
.con-search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.con-sr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: background 0.15s;
}
.con-sr-card:hover {
  background: rgba(255,255,255,0.06);
}
.con-sr-name {
  font-size: 14px;
  font-weight: 600;
}
.con-sr-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.con-sr-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.con-sr-status {
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}
.con-sr-status.st-new,
.con-sr-status.st-in_progress { background: rgba(89,195,255,0.12); color: #59c3ff; }
.con-sr-status.st-contracted { background: rgba(76,175,80,0.12); color: #4caf50; }
.con-sr-status.st-paid { background: rgba(255,152,0,0.12); color: #ff9800; }
.con-sr-status.st-cancelled { background: rgba(239,83,80,0.12); color: #ef5350; }
.con-sr-op {
  font-size: 11px;
  color: var(--muted);
}
.con-sr-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 14px;
}
