/* Shared layout — CIMS Mitra AI platform (intelligent.html) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1e5aa8;
  --blue-light: #e8f0fa;
  --blue-dark: #154278;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --green: #16a34a;
  --sidebar-w: 240px;
  --header-h: 72px;
}

body.mitra-layout {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

.mitra-layout a { color: var(--blue); text-decoration: none; }
.mitra-layout a:hover { text-decoration: underline; }

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand:hover { text-decoration: none; }

.sidebar-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-brand-text {
  line-height: 1.25;
  color: #000;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sidebar-brand-text .dept-of {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-brand-text .dept-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}

.sidebar-brand-text .dept-govt {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-600);
  font-size: 13px;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav a:hover { background: var(--gray-50); color: var(--blue); text-decoration: none; }

.nav a.active {
  background: var(--blue-light);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  text-align: center;
  font-size: 14px;
  line-height: 18px;
}

.ai-widget {
  margin: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #1e5aa8 0%, #2563eb 100%);
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
}

.ai-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
}

.ai-widget-header .dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
}

.ai-widget p { opacity: 0.95; margin-bottom: 10px; line-height: 1.4; }

.ai-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-chips span {
  background: rgba(255,255,255,0.15);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: default;
}

.ai-input {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.ai-input input {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
}

.ai-input button {
  background: #fff;
  color: var(--blue);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: #fff;
  border-top: 1px solid #000;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 0;
}

.topbar-platform {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  color: var(--gray-600);
  flex-shrink: 0;
}

.topbar-platform-text { min-width: 0; }

.topbar-platform-text h1 {
  font-size: 17px;
  color: #000;
  font-weight: 700;
  line-height: 1.25;
}

.topbar-platform-text p {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-select {
  font-size: 13px;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
}

.notif { position: relative; cursor: pointer; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-user { position: relative; }

.topbar-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.topbar-user-trigger:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-user-avatar img { width: 16px; height: 16px; }

.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  z-index: 200;
}

.topbar-user-dropdown button {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
}

.topbar-user-dropdown button:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.content {
  padding: 24px;
  flex: 1;
}

.announcement {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  margin-top: 24px;
}

.announcement-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-700);
}

.announcement-left strong { color: var(--gray-800); }

.announcement a { font-size: 12px; white-space: nowrap; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
}
