/* Buildryse ERP Mockup — Ryse Brand Theme */
/* Based on: 2026-06-26-ryse-crm-theme-design.md */

:root {
  /* Primary */
  --ryse-red: #C1121F;
  --ryse-red-dark: #9B0D18;
  --ryse-red-bright: #E8293A;
  --ryse-red-win95: #eb131f;
  --ryse-navy: #003087;
  --ryse-navy-mid: #0A4DA6;
  --ryse-navy-bright: #1565C0;

  /* Accents */
  --ryse-amber: #FFB800;
  --ryse-teal: #358594;
  --ryse-dark: #0A1628;
  --ryse-deep-navy: #001b3d;

  /* Neutrals */
  --ryse-white: #FFFFFF;
  --ryse-off-white: #F4F6FA;
  --ryse-light: #EBF0F8;
  --ryse-silver: #c0c0c0;
  --ryse-gray: #4A5568;
  --ryse-light-gray: #D1D9E6;
  --ryse-border-dark: #808080;
  --ryse-border-darker: #404040;

  /* Typography */
  --font-heading: 'Montserrat', 'Quicksand', Georgia, serif;
  --font-body: 'Open Sans', 'Nunito Sans', Tahoma, sans-serif;
  --font-ui: 'Montserrat', Tahoma, sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: clamp(1rem, 5vw, 4rem);

  /* Radius */
  --radius-pill: 999px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  /* Shadows */
  --shadow-card: 0 8px 30px rgba(0, 48, 135, 0.10);
  --shadow-card-hover: 0 20px 50px rgba(0, 48, 135, 0.15);
  --shadow-dropdown: 0 10px 30px rgba(0, 48, 135, 0.12);
  --shadow-header: 0 2px 20px rgba(0, 48, 135, 0.10);

  /* Layout */
  --sidebar-width: 260px;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--ryse-off-white);
  color: var(--ryse-dark);
  line-height: 1.65;
  font-size: 14px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--ryse-white);
  border-right: 1px solid var(--ryse-light-gray);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ryse-light-gray);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--ryse-red);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--ryse-navy);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

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

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ryse-gray);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ryse-gray);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--ryse-red);
  color: white;
}

.nav-item.active {
  background: var(--ryse-red);
  color: white;
  border-left: 3px solid var(--ryse-navy);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid var(--ryse-light-gray);
  padding: 16px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--ryse-navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
}

.user-name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--ryse-dark);
  font-size: 13px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Urgency Bar */
.urgency-bar {
  background: linear-gradient(90deg, var(--ryse-dark) 0%, var(--ryse-navy) 55%, var(--ryse-red) 100%);
  padding: 0.8rem var(--space-xl);
  color: white;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.urgency-bar-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.urgency-dot {
  width: 8px;
  height: 8px;
  background: var(--ryse-red-bright);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.urgency-cta {
  background: white;
  color: var(--ryse-red);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.72rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Top Header */
.top-header {
  background: var(--ryse-white);
  border-bottom: 4px solid var(--ryse-red);
  box-shadow: var(--shadow-header);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ryse-off-white);
  border: 1px solid var(--ryse-light-gray);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 360px;
}

.search-icon {
  color: var(--ryse-gray);
  font-size: 14px;
}

.search-input {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ryse-dark);
  width: 100%;
}

.search-input::placeholder {
  color: var(--ryse-gray);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--ryse-red);
  color: white;
  border-color: var(--ryse-red);
}

.btn-primary:hover {
  background: var(--ryse-red-dark);
  border-color: var(--ryse-red-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--ryse-navy);
  color: white;
  border-color: var(--ryse-navy);
}

.btn-secondary:hover {
  background: var(--ryse-navy-mid);
  border-color: var(--ryse-navy-mid);
}

.btn-outline {
  background: transparent;
  color: var(--ryse-navy);
  border: 2px solid var(--ryse-navy);
}

.btn-outline:hover {
  background: var(--ryse-navy);
  color: white;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--ryse-gray);
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--ryse-off-white);
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1440px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ryse-dark);
}

.page-subtitle {
  font-family: var(--font-body);
  color: var(--ryse-gray);
  font-size: 14px;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--ryse-white);
  border: 1px solid var(--ryse-light-gray);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.stat-card.red-accent::before {
  background: var(--ryse-red);
}

.stat-card.navy-accent::before {
  background: var(--ryse-navy);
}

.stat-card.teal-accent::before {
  background: var(--ryse-teal);
}

.stat-card.amber-accent::before {
  background: var(--ryse-amber);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(193, 18, 31, 0.5);
  background: rgba(193, 18, 31, 0.2);
  color: var(--ryse-red-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ryse-gray);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--ryse-navy);
  margin-bottom: 8px;
  line-height: 1.1;
}

.stat-value.red {
  color: var(--ryse-red);
}

.stat-change {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
}

.stat-change.positive {
  color: #166534;
}

.stat-change.negative {
  color: var(--ryse-red);
}

/* Card */
.card {
  background: var(--ryse-white);
  border: 1px solid var(--ryse-light-gray);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ryse-dark);
}

.card-body {
  padding: 0;
}

/* Filters */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ryse-light-gray);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ryse-gray);
}

.filter-select {
  padding: 6px 12px;
  border: 1px solid var(--ryse-light-gray);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  background: white;
  color: var(--ryse-dark);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--ryse-navy-bright);
  outline: 2px solid var(--ryse-navy-bright);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: var(--ryse-navy);
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: white;
}

.data-table th:first-child {
  border-radius: var(--radius-xs) 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 var(--radius-xs) 0 0;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ryse-light-gray);
  color: var(--ryse-dark);
}

.data-table tbody tr {
  background: white;
}

.data-table tbody tr:nth-child(even) {
  background: var(--ryse-off-white);
}

.data-table tbody tr:hover {
  background: var(--ryse-light);
}

.data-table tbody tr.active-row {
  background: var(--ryse-red);
  color: white;
}

.data-table tbody tr.active-row td {
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-active {
  background: #f0fdf4;
  color: #166534;
}

.badge-active::before {
  background: #22c55e;
}

.badge-pending {
  background: #fffbeb;
  color: #92400e;
}

.badge-pending::before {
  background: var(--ryse-amber);
}

.badge-completed {
  background: #eff6ff;
  color: #1e40af;
}

.badge-completed::before {
  background: var(--ryse-navy-bright);
}

.badge-cancelled {
  background: #fef2f2;
  color: #991b1b;
}

.badge-cancelled::before {
  background: var(--ryse-red);
}

/* Text helpers */
.text-muted { color: var(--ryse-gray); }
.text-secondary { color: var(--ryse-gray); }
.font-medium { font-weight: 600; }
.font-mono { font-family: var(--font-mono); }

/* Links */
.link {
  color: var(--ryse-navy-bright);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
  color: var(--ryse-navy);
}

/* Warning / Alert Box */
.warning-box {
  background: rgba(193, 18, 31, 0.07);
  border: 2px solid rgba(193, 18, 31, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: var(--space-lg);
}

.warning-box-title {
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ryse-red);
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .logo-text, .sidebar .nav-label, .sidebar .nav-section-title, .sidebar .user-name { display: none; }
  .main-content { margin-left: 64px; }
  .stats-grid { grid-template-columns: 1fr; }
  .top-header { flex-direction: column; gap: 12px; height: auto; }
  .header-search { width: 100%; }
  .urgency-bar { flex-direction: column; gap: 8px; text-align: center; }
}


/* ---------- Auth pages ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--ryse-navy) 0%, #0f1623 100%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
}

.auth-card {
  background: var(--ryse-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 2.5rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.auth-brand .logo-icon {
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
}

.auth-brand .logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ryse-navy);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ryse-navy);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--ryse-gray);
  text-align: center;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ryse-navy);
  margin-bottom: 0.5rem;
}

.auth-form .form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--ryse-silver);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form .form-input:focus {
  outline: none;
  border-color: var(--ryse-red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}

.auth-form .form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--ryse-gray);
  margin-top: 0.375rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Flash messages ---------- */
.flash-messages {
  padding: var(--space-md) var(--space-xl);
}

.flash {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.flash-success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
  background: rgba(193, 18, 31, 0.08);
  color: var(--ryse-red);
  border: 1px solid rgba(193, 18, 31, 0.25);
}

/* Make sidebar logout clickable */
.sidebar-footer .user-menu {
  text-decoration: none;
  cursor: pointer;
}

.sidebar-footer .user-menu:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}
