/* ==========================================================================
   WEBSIRG MOBILE CONTROLLER SAAS - THEME & DESIGN TOKENS
   Websirg Digital Solution (Contact: 9354631515)
   ========================================================================== */

/* Google Fonts loaded asynchronously in HTML via non-blocking link to avoid render waterfall */

:root {
  /* Brand Palette (Derived from Websirg 3D Emblem & Typography) */
  --brand-navy-900: #0A192F;
  --brand-navy-800: #0F2548;
  --brand-navy-700: #1B3B6F;
  --brand-navy-600: #214E8C;
  --brand-blue: #2563EB;
  --brand-blue-light: #3B82F6;
  
  --brand-orange-600: #C2410C;
  --brand-orange: #EA580C;
  --brand-orange-bright: #F97316;
  --brand-orange-light: #FFEDD5;
  --brand-orange-glow: rgba(249, 115, 22, 0.25);

  /* Functional Status Colors */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);
  
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.25);
  
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.25);
  
  --info: #06B6D4;
  --info-bg: rgba(6, 182, 212, 0.12);
  --info-border: rgba(6, 182, 212, 0.25);

  /* LIGHT THEME (Default) */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-secondary: #F1F5F9;
  --bg-surface-tertiary: #E2E8F0;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #F97316;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E2E8F0;
  --sidebar-text: #475569;
  --sidebar-text-active: #EA580C;
  --sidebar-item-hover: #F8FAFC;
  --sidebar-item-active: #FFF7ED;

  --navbar-bg: rgba(255, 255, 255, 0.88);
  --navbar-border: #E2E8F0;
  
  --card-bg: #FFFFFF;
  --table-head-bg: #F8FAFC;
  --table-row-hover: #F8FAFC;
  --input-bg: #FFFFFF;

  /* Typography & Layout Tokens - Premium Inter Sans */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 78px;
  --navbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DARK THEME */
[data-theme="dark"] {
  --bg-app: #090D16;
  --bg-surface: #0F172A;
  --bg-surface-secondary: #1E293B;
  --bg-surface-tertiary: #334155;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;
  
  --border-subtle: #1E293B;
  --border-medium: #334155;
  --border-focus: #F97316;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.45);
  
  --sidebar-bg: #0B1120;
  --sidebar-border: #1E293B;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FB923C;
  --sidebar-item-hover: #131D33;
  --sidebar-item-active: rgba(249, 115, 22, 0.12);

  --navbar-bg: rgba(11, 17, 32, 0.88);
  --navbar-border: #1E293B;
  
  --card-bg: #0F172A;
  --table-head-bg: #131D33;
  --table-row-hover: #16223B;
  --input-bg: #131D33;
}

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

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.022em;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-orange-bright);
}

img, svg {
  vertical-align: middle;
}

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

/* Common Utility Classes */
.text-brand-orange { color: var(--brand-orange-bright) !important; }
.text-brand-navy { color: var(--brand-navy-800) !important; }
[data-theme="dark"] .text-brand-navy { color: #93C5FD !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* Padding Utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.p-5 { padding: 20px !important; }
.p-6 { padding: 24px !important; }

.px-1 { padding-left: 4px !important; padding-right: 4px !important; }
.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }

.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }

/* Modern Alert Callout Card */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-orange-bright);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.alert-card.alert-info {
  border-left-color: var(--brand-blue);
}
.alert-card.alert-success {
  border-left-color: var(--success);
}
.alert-card.alert-danger {
  border-left-color: var(--danger);
}
.alert-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.alert-content {
  flex: 1;
}
.alert-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.alert-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
