/* ABHIMO DMS - Comprehensive Zero-Dependency Design System */
:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-light: #fff7ed;
  --accent-border: #ffedd5;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #ea580c;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --indigo: #4f46e5;
  --indigo-light: #eef2ff;
  --emerald: #059669;
  --emerald-light: #ecfdf5;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --rose: #e11d48;
  --rose-light: #fff1f2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Header */
.top-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--accent);
}

.brand-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-info-text .user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-info-text .user-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rose-light);
  color: var(--rose);
  border: 1px solid #fecdd3;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-signout:hover {
  background: #ffe4e6;
}

/* Main Container */
.main-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #0d1b2a 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.hero-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(234, 88, 12, 0.2);
  color: #fdba74;
  border: 1px solid rgba(234, 88, 12, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-heading {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-desc {
  color: #cbd5e1;
  font-size: 0.9rem;
  max-width: 680px;
  line-height: 1.6;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.metric-icon-blue { background: var(--blue-light); color: var(--blue); }
.metric-icon-emerald { background: var(--emerald-light); color: var(--emerald); }
.metric-icon-amber { background: var(--amber-light); color: var(--amber); }
.metric-icon-purple { background: var(--purple-light); color: var(--purple); }

.metric-content .metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-content .metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.metric-content .metric-subtext {
  font-size: 0.75rem;
  margin-top: 2px;
}

/* 2-Column Section Layout */
.dashboard-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

@media (max-width: 960px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 640px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.module-card-full {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .module-card-full {
    grid-column: span 1;
  }
}

.module-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.module-icon-indigo { background: #eef2ff; color: #4f46e5; }
.module-icon-emerald { background: var(--emerald-light); color: var(--emerald); }
.module-icon-orange { background: var(--accent-light); color: var(--accent); }
.module-icon-cyan { background: #ecfeff; color: #0891b2; }
.module-icon-violet { background: #f5f3ff; color: #7c3aed; }

.module-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.module-badge-indigo { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }
.module-badge-emerald { background: var(--emerald-light); color: var(--emerald); border-color: #a7f3d0; }
.module-badge-orange { background: var(--accent-light); color: var(--accent); border-color: #fed7aa; }
.module-badge-cyan { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.module-badge-violet { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

.module-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.module-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
}

.text-indigo { color: #4f46e5; }
.text-emerald { color: var(--emerald); }
.text-orange { color: var(--accent); }
.text-cyan { color: #0891b2; }
.text-violet { color: #7c3aed; }

/* Right Sidebar Panels (Session Information & Quick Access) */
.sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.8rem;
}

.session-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.session-info-val {
  font-weight: 700;
  color: var(--text-main);
}

.quick-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s;
}

.quick-link-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.quick-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Form Card Container (User Creation, CAMS forms, etc.) */
.form-page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.form-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-2xl);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 36px;
  width: 100%;
  max-width: 768px;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--indigo);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control, .form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-input:focus, .form-select:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-with-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-button .form-control {
  flex: 1;
}

.btn-icon {
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: #e2e8f0;
}

.btn-load {
  padding: 10px 16px;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
}

.btn-load:hover {
  background: #dbeafe;
}

/* Action Button Bar */
.form-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  margin-top: 8px;
}

.btn-add, .btn-submit {
  background: var(--indigo);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.1s;
}

.btn-add:hover, .btn-submit:hover {
  background: #4338ca;
}

.btn-reset {
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-reset:hover {
  background: #cbd5e1;
}

.btn-exit, .btn-danger {
  background: var(--rose);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-exit:hover, .btn-danger:hover {
  background: #be123c;
}

/* Alert Boxes */
.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--emerald-light);
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-warning {
  background: var(--amber-light);
  border-color: #fde68a;
  color: #92400e;
}

.alert-error {
  background: var(--rose-light);
  border-color: #fecdd3;
  color: #9f1239;
}

/* Next Steps Box */
.next-steps-card {
  background: var(--emerald-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.next-steps-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.next-steps-desc {
  font-size: 0.75rem;
  color: #047857;
  margin-bottom: 14px;
}

.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.next-step-item {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.next-step-item:hover {
  background: #f0fdf4;
  border-color: var(--emerald);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.next-step-item-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #065f46;
}

.next-step-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Slide-out Sidebar Panels for Lookups */
.lookup-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  box-shadow: var(--shadow-2xl);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.lookup-sidebar.open {
  transform: translateX(0);
}

.lookup-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lookup-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.lookup-list {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.modal-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-title-wrap p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-close-btn {
  color: var(--text-subtle);
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-menu-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s;
}

.modal-menu-item:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateX(2px);
}

/* Footer */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: auto;
}
