@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Claflin A.L.M. Official Brand Tokens */
  --color-primary: #0A3B73;        /* Official Claflin Primary Blue */
  --color-primary-hover: #072c57;
  --color-navy: #05294B;           /* Brand Container Navy */
  --color-accent: #009CDE;         /* Single Accent Cyan */
  --color-accent-hover: #007bb0;
  
  --color-success: #00A99D;        /* Teal */
  --color-warning: #FFC20E;        /* Amber */
  --color-error: #E35205;          /* Brand Orange/Red Error */
  
  --text-main: #333333;            /* Primary Body Text */
  --text-secondary: #5a6268;       /* Labels & Secondary */
  --text-muted: #868e96;           /* Placeholders & Muted */
  --text-on-primary: #ffffff;
  
  --bg-app: #f8f9fa;               /* App background */
  --bg-card: #ffffff;              /* Card / panel background */
  --bg-input-focus: #f0f8ff;       /* Light alice blue focus */
  --bg-active: #e6f0fa;            /* Active item background */
  
  --border-light: #dae0e5;         /* Borders and dividers */
  --border-focus: #009CDE;         /* Focused border (= accent) */
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 3px 5px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 12px rgba(0,0,0,0.08);
  
  --font-family: 'Open Sans', 'Segoe UI', sans-serif;
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background-color: var(--bg-card);
  padding: 0.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 3px solid var(--color-accent);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-section h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-primary);
}

.logo-icon {
  background-color: var(--color-primary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Toggle Switch Styling */
.view-toggle-container {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  padding: 0.15rem;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 0.15rem;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.3rem 0.8rem;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover:not(.active) {
  color: var(--color-primary);
  background-color: rgba(10, 59, 115, 0.05);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: fit-content;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Dense Layout */
main {
  flex: 1;
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 200ms ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User Grid: Expanded 3-Column Layout */
.user-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 1080px) {
  .user-layout-grid {
    grid-template-columns: 360px minmax(380px, 1fr) 380px;
    align-items: start;
  }
}

/* User Sidebar Container */
.user-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

/* Cards & Panels */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}

/* FAQ Panel Styling (Expanded Quick Help Box) */
.faq-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.faq-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.85rem;
  border-bottom: 1.5px solid var(--border-light);
  padding-bottom: 0.4rem;
}

.faq-item {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-light);
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-q {
  font-weight: 700;
  font-size: 0.825rem;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.faq-a {
  font-size: 0.785rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Form Styling */
.form-group {
  margin-bottom: 0.75rem;
}

.form-group label,
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.required-star {
  color: var(--color-error);
  font-weight: 700;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-light);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.15);
  background-color: var(--bg-input-focus);
}

.form-control.field-invalid {
  border-color: var(--color-error);
  background-color: #fff8f8;
}

/* Textarea Height Customization */
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

textarea.form-control.taller-textarea {
  min-height: 140px;
  max-height: 220px;
}

.char-counter {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.15rem;
}

/* Banners */
.notification-banner {
  background-color: var(--bg-input-focus);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.validation-alert {
  background-color: #fef2f2;
  border: 1px solid #f87171;
  color: var(--color-error);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.775rem;
  margin-bottom: 0.75rem;
  display: none;
  font-weight: 600;
}

/* User Sidebar */
.user-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compact-ticket-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.compact-ticket-item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-active);
}

.compact-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.compact-ticket-id {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-primary);
}

.compact-ticket-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.compact-ticket-status-text {
  font-size: 0.725rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* IT STAFF VIEW: Vertical Navigation Sidebar Layout */
.it-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 900px) {
  .it-layout-grid {
    grid-template-columns: 210px 1fr;
  }
}

.it-vertical-nav {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.it-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: none;
  padding: 0.55rem 0.75rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.it-nav-btn:hover {
  background-color: var(--bg-app);
  color: var(--color-primary);
}

.it-nav-btn.active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.it-nav-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}

/* COMPACT SHORTER IT DASHBOARD METRIC TILES */
.it-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.metric-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metric-card.active-filter {
  background-color: var(--bg-active);
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
}

.metric-card h3 {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

/* METRICS & REPORTING DASHBOARD ANALYTICS STYLES */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.analytics-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.analytics-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem;
}

.kpi-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kpi-box {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  flex: 1;
}

.kpi-title {
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.kpi-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
}

.bar-item {
  margin-bottom: 0.55rem;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.bar-track {
  background-color: var(--bg-app);
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: 4px;
  transition: width 300ms ease-in-out;
}

/* Badges / Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.675rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-low { background-color: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; font-weight: 600; }
.badge-medium { background-color: #fefce8; color: #854d0e; border: 1px solid #fef08a; font-weight: 600; }
.badge-high { background-color: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; }
.badge-unassigned, .badge-needs-priority { background-color: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; font-weight: 700; }

.badge-submitted { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; font-weight: 600; }
.badge-needs-routing, .badge-needs-staff, .badge-needs-priority-level, .badge-awaiting-action { background-color: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-weight: 600; }
.badge-in-progress { background-color: rgba(0, 156, 222, 0.12); color: var(--color-primary); border: 1px solid rgba(0, 156, 222, 0.3); font-weight: 600; }
.badge-completed { background-color: transparent; color: var(--text-secondary); border: none; font-weight: 600; padding: 0.15rem 0.35rem; }
.badge-reopened { background-color: rgba(10, 59, 115, 0.08); color: var(--color-primary); border: 1px solid var(--border-light); font-weight: 600; }

.priority-select.needs-level {
  border: 1.5px solid #8b5cf6 !important;
  background-color: #f5f3ff !important;
  color: #6d28d9 !important;
  font-weight: 700 !important;
}

/* IT Ticket List */
.ticket-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.ticket-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.ticket-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.ticket-id {
  font-family: monospace;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.ticket-desc {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ticket-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 0.4rem;
  margin-top: 0.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ticket-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.assign-select,
.priority-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-md);
  outline: none;
}

.status-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--color-primary);
  background-color: var(--color-primary);
  color: white;
  transition: all var(--transition-fast);
}

.status-btn:hover {
  background-color: var(--color-primary-hover);
}

.status-btn.btn-resolve {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.status-btn.btn-resolve:hover {
  background-color: #00877d;
}

.btn-header-login {
  background-color: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-header-login:hover {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.status-btn.btn-reopen {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.status-btn.btn-reopen:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.technician-tag {
  font-size: 0.725rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 41, 75, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

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

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

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

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.detail-value {
  font-size: 0.825rem;
  color: var(--text-main);
}

.detail-desc-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-top: 0.35rem;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}
