/* [fitdesk-v2.1.0-sync] */
/** FitDesk Design System v2.1.0 **/
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #090D14;
  --bg-surface: #0E131E;
  --bg-card: rgba(15, 20, 31, 0.88);
  --bg-card-hover: rgba(22, 30, 46, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.14);
  --border-glass: rgba(255, 255, 255, 0.08);
  
  --primary: #00D5E5;
  --primary-dark: #00B4C6;
  --primary-glow: rgba(0, 213, 229, 0.16);
  --secondary: #38BDF8;
  --accent: #F43F5E;
  --success: #10B981;
  --warning: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-heading: 'Geist', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse 70% 35% at 50% -10%, rgba(0, 213, 229, 0.05), transparent 70%);
  background-size: 24px 24px, 100% 100%;
  background-position: 0 0, center top;
  background-repeat: repeat, no-repeat;
  letter-spacing: -0.006em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}

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

/* Glass Card Utility - Realistic Obsidian Bevels */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    0 10px 30px -5px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease, 
              box-shadow 0.25s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 213, 229, 0.25);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.14),
    0 16px 36px -6px rgba(0, 0, 0, 0.6),
    0 0 20px -6px rgba(0, 213, 229, 0.15);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 5%;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 13, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons - Tactile Physics with Inset Lighting */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  font-size: 0.9rem;
  line-height: 1.4;
  user-select: none;
}

.btn:active {
  transform: scale(0.97) !important;
}

.btn-primary {
  background: linear-gradient(180deg, #00D5E5 0%, #00B4C6 100%);
  color: #031016;
  border: 1px solid rgba(0, 213, 229, 0.5);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 14px rgba(0, 213, 229, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #26e2f0 0%, #00bfd2 100%);
  transform: translateY(-1px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 18px rgba(0, 213, 229, 0.35);
  color: #031016;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #FCA5A5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-danger:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Dashboard Segmented Tabs Bar */
.dashboard-tabs {
  background: rgba(14, 19, 29, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.35rem;
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.dashboard-tabs::-webkit-scrollbar {
  height: 4px;
}

.dashboard-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.dashboard-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.dashboard-tabs .btn {
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

.dashboard-tabs .btn-outline {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.dashboard-tabs .btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.dashboard-tabs .btn-primary {
  background: linear-gradient(180deg, #00F2FE 0%, #00C8DE 100%);
  color: #07111A;
  font-weight: 600;
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 12px rgba(0, 242, 254, 0.3);
}

/* Hero Section */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 680px;
  margin-bottom: 3.5rem;
  line-height: 1.6;
}

.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  width: 100%;
}

.portal-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

.portal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.portal-card h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.portal-card p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Forms - Tangible Obsidian Inputs */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input, select.form-input, textarea.form-input {
  width: 100%;
  padding: 0.75rem 1.1rem;
  background: rgba(10, 13, 20, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus, select.form-input:focus, textarea.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(13, 17, 26, 0.95);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input[type="date"], input[type="datetime-local"], input[type="time"] {
  color-scheme: dark;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2300f2fe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1.15rem !important;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  cursor: pointer !important;
  width: 2.5rem !important;
}

/* Tables - High Precision Data Grid */
.table-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(13, 17, 26, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.35) rgba(255, 255, 255, 0.04);
}

.table-container::-webkit-scrollbar {
  height: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

th {
  padding: 0.9rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(10, 14, 22, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  color: var(--text-main);
  transition: background 0.15s ease;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

/* Micro-Badges */
.badge {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

.badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expired {
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-suspended {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Flash Messages */
.flash-msg {
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.flash-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.flash-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6EE7B7;
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 26, 38, 0.85) 0%, rgba(13, 17, 26, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 32px -6px rgba(0, 0, 0, 0.5);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-value {
  font-size: 2.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Responsive Navbar & Kiosk Layouts */
@media (max-width: 950px) {
  .navbar {
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem 3% !important;
    text-align: center;
  }
  .navbar .logo {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .navbar > div {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    width: 100%;
  }
  .navbar .btn {
    margin: 0 !important;
    flex: 1;
    min-width: 130px;
    max-width: 240px;
    padding: 0.65rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* Responsive Modals & Form Grids on Mobile Devices */
@media (max-width: 768px) {
  [id$="Modal"] {
    padding: 0.5rem !important;
    box-sizing: border-box !important;
  }
  [id$="Modal"] .glass-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.35rem 1rem !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }
  [id$="Modal"] form div[style*="grid-template-columns"],
  [id$="Modal"] div[style*="grid-template-columns"],
  form div[style*="grid-template-columns"],
  .glass-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  [id$="Modal"] form div[style*="display: flex"],
  [id$="Modal"] div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }
  [id$="Modal"] button, [id$="Modal"] .btn, [id$="Modal"] a.btn {
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}

/* Universal Page Container Constraints */
main, .superadmin-main {
  width: 100% !important;
  max-width: 1400px;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Large Tablets & Surface Devices Layout (769px to 1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
  main, .superadmin-main {
    padding: 2rem 2.5% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .dashboard-header {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .dashboard-tabs {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .table-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    box-sizing: border-box !important;
  }
  table {
    min-width: 780px;
  }
  th, td {
    padding: 0.8rem 0.95rem;
    font-size: 0.88rem;
  }
  .section-controls {
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }
  .section-controls form {
    flex-wrap: wrap !important;
    max-width: 100% !important;
  }
  .section-controls input[type="text"] {
    max-width: 100% !important;
  }
}

