/* =========================================================================
   WorkArea Design System
   Fonts (Inter) and icons (Bootstrap Icons) are loaded via CDN link tags in
   Views/Shared/_Layout.cshtml <head> - see that file for the exact links.
   ========================================================================= */

:root {
  /* Brand */
  --navy-950: #0a1e3d;
  --navy-900: #0e2a52;
  --navy-800: #123566;
  --blue-700: #1c5cc4;
  --blue-600: #2569db;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  /* Status */
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --sky-600:   #2563eb;
  --sky-100:   #dbeafe;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;

  /* Neutrals */
  --ink-900: #111827;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --page-bg: #f4f6fb;
  --card-bg: #ffffff;

  /* Elevation / shape */
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.06);
  --shadow-pop:  0 8px 24px rgba(16,24,40,.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }
a { color: var(--blue-600); }

/* ===== Brand mark ===== */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark .brand-word { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-mark .brand-word .work { color: var(--ink-900); }
.brand-mark .brand-word .area { color: var(--blue-600); }
.brand-mark.on-dark .brand-word .work { color: #fff; }
.brand-mark.on-dark .brand-word .area { color: var(--blue-400); }

/* ===== App shell: sidebar + main ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #cfe0ff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 1040;
  transition: transform .2s ease;
}
.sidebar-brand { padding: 20px 22px 16px; }
.sidebar-nav { padding: 8px 14px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #b9cdf0 !important; text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; color: #7c9bd6; margin-right: 12px; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.sidebar-link.active { background: var(--blue-600); color: #fff !important; box-shadow: var(--shadow-card); }
.sidebar-link.active i { color: #fff; }
.sidebar-link .badge-count {
  margin-left: auto; background: var(--red-600); color: #fff; font-size: .7rem;
  border-radius: 999px; padding: 1px 7px; font-weight: 700;
}
.sidebar-foot { padding: 14px 22px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .name { color: #fff; }
.sidebar-foot .role { color: #7c9bd6; }
.sidebar-backdrop { display: none; }

/* ===== Main column ===== */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; background: var(--card-bg); border-bottom: 1px solid var(--ink-200);
  position: sticky; top: 0; z-index: 10;
}
.sidebar-toggle {
  display: none; border: none; background: var(--ink-100); width: 38px; height: 38px;
  border-radius: var(--radius-sm); align-items: center; justify-content: center; font-size: 1.1rem; color: var(--ink-700);
}
.topbar-search { flex: 1; max-width: 380px; position: relative; }
.topbar-search input {
  width: 100%; border: 1px solid var(--ink-200); background: var(--ink-100);
  border-radius: 999px; padding: 8px 16px 8px 36px; font-size: .86rem;
}
.topbar-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-500); }
.topbar-spacer { flex: 1; }
.topbar-bell {
  position: relative; width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink-100); color: var(--ink-700); font-size: 1.05rem; flex-shrink: 0;
  text-decoration: none;
}
.topbar-bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-600); border: 2px solid #fff; }
.topbar-user { display: flex; align-items: center; }
.topbar-user .name { font-size: .84rem; font-weight: 600; line-height: 1.15; margin-bottom: 0; }
.topbar-user .role { font-size: .72rem; color: var(--ink-500); }

.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-100); color: var(--blue-700); font-weight: 700; font-size: .82rem;
}
.avatar-circle.sm { width: 30px; height: 30px; font-size: .72rem; margin-right: 10px; }

.page-body { padding: 24px 24px 40px; }
@media (min-width: 992px) { .page-body { padding: 28px 32px 48px; } }

/* ===== Cards ===== */
.card-surface, .card {
  background: var(--card-bg); border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card); border: 1px solid var(--ink-100) !important;
}

.stat-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); border: 1px solid var(--ink-100);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 2px;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: .82rem; color: var(--ink-500); font-weight: 500; }
.stat-card .stat-link { font-size: .78rem; color: var(--blue-600); font-weight: 600; text-decoration: none; }

/* status dots */
.status-pill { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; flex-shrink: 0; }
.status-working { color: var(--green-600); } .status-working .dot { background: var(--green-600); }
.status-break { color: var(--amber-600); } .status-break .dot { background: var(--amber-600); }
.status-scheduled { color: var(--sky-600); } .status-scheduled .dot { background: var(--sky-600); }
.status-off { color: var(--ink-500); } .status-off .dot { background: var(--ink-300); }

.badge-soft { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-soft.green { background: var(--green-100); color: var(--green-600); }
.badge-soft.amber { background: var(--amber-100); color: var(--amber-600); }
.badge-soft.sky { background: var(--sky-100); color: var(--sky-600); }
.badge-soft.red { background: var(--red-100); color: var(--red-600); }
.badge-soft.gray { background: var(--ink-100); color: var(--ink-500); }

/* Buttons */
.btn-brand, .btn-primary {
  background: var(--blue-600) !important; border: 1px solid var(--blue-600) !important; color: #fff !important; font-weight: 600;
  border-radius: var(--radius-sm) !important; padding: 9px 18px; font-size: .9rem;
}
.btn-brand:hover, .btn-primary:hover { background: var(--blue-700) !important; border-color: var(--blue-700) !important; }
.btn-brand-outline, .btn-outline-secondary, .btn-outline-primary {
  background: #fff; font-weight: 600;
  border-radius: var(--radius-sm) !important; padding: 9px 18px; font-size: .9rem;
}
.btn-outline-primary { color: var(--blue-600) !important; border-color: var(--ink-200) !important; }
.btn-danger { border-radius: var(--radius-sm) !important; }
.btn-sm { border-radius: 7px !important; }

/* Forms */
.form-control, .form-select {
  border-radius: var(--radius-sm); border-color: var(--ink-200); padding: 9px 12px; font-size: .92rem;
}
.form-control:focus, .form-select:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px var(--blue-50); }

/* Tables */
.table thead { background: transparent; }
.table thead th { color: var(--ink-500); font-size: .78rem; font-weight: 600; text-transform: none; border-bottom: 1px solid var(--ink-200); padding-bottom: 10px; }
.table td { vertical-align: middle; padding-top: 12px; padding-bottom: 12px; }

/* ===== Login split screen ===== */
.auth-shell { display: flex; min-height: 100vh; }
.auth-hero {
  flex: 1.1; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
  background-image:
    url('/images/hero-bg.svg'),
    radial-gradient(700px 500px at 85% 15%, rgba(125,181,255,.55), transparent 60%),
    radial-gradient(600px 500px at 20% 90%, rgba(59,130,246,.4), transparent 60%),
    radial-gradient(400px 300px at 60% 55%, rgba(147,197,253,.25), transparent 60%),
    linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--blue-700) 100%);
  background-size: cover, auto, auto, auto, auto;
  background-position: center bottom, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat;
}
.auth-hero-content { position: relative; z-index: 1; }
.auth-tagline { color: #fff; font-size: 1.5rem; font-weight: 700; line-height: 1.35; max-width: 380px; }
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-input-group { position: relative; margin-bottom: 14px; }
.auth-input-group i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-500); z-index: 5; }
.auth-input-group input { padding-left: 40px !important; }
@media (max-width: 767px) { .auth-hero { display: none; } }

/* ===== Time tracking big clock ===== */
.clock-card {
  background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  border: 1px solid var(--ink-100); padding: 36px; text-align: center;
}
.clock-display { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock-status-badge { display: inline-block; margin-top: 4px; }
.clock-job-name { font-size: 1.1rem; font-weight: 700; margin-top: 18px; }
.clock-job-sub { color: var(--ink-500); font-size: .88rem; }
.clock-meta-row { display: flex; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.clock-meta-row > div { padding: 4px 24px; text-align: left; border-left: 1px solid var(--ink-200); }
.clock-meta-row > div:first-child { border-left: none; }
.clock-meta-label { font-size: .74rem; color: var(--ink-500); }
.clock-meta-value { font-size: .92rem; font-weight: 700; }

/* ===== Job list cards ===== */
.job-card {
  display: flex; align-items: center;
  background: var(--card-bg); border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 10px; text-decoration: none; color: inherit;
}
.job-card:hover { border-color: var(--blue-400); color: inherit; }
.job-card .job-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0; margin-right: 14px;
  background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.job-card .job-title { font-weight: 700; font-size: .94rem; }
.job-card .job-sub { color: var(--ink-500); font-size: .82rem; margin-top: 2px; }
.job-card .job-sub i { margin-right: 4px; }
.job-card .job-right { margin-left: auto; display: flex; align-items: center; }
.job-card .job-right .badge-soft { margin-right: 10px; }

/* ===== Notification list ===== */
.notif-item { display: flex; padding: 14px 16px; border-bottom: 1px solid var(--ink-100); }
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; margin-right: 14px;
  background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.notif-item.unread { background: var(--blue-50); }
.notif-item .notif-title { font-weight: 700; font-size: .9rem; }
.notif-item .notif-msg { color: var(--ink-700); font-size: .85rem; margin-top: 2px; }
.notif-item .notif-time { color: var(--ink-500); font-size: .76rem; margin-top: 4px; }

/* ===== Profile ===== */
.profile-header { display: flex; align-items: center; margin-bottom: 24px; }
.profile-header .avatar-circle { width: 72px; height: 72px; font-size: 1.5rem; margin-right: 18px; }
.profile-field { padding: 10px 0; border-bottom: 1px solid var(--ink-100); font-size: .9rem; }
.profile-field .label { color: var(--ink-500); }

/* ===== Mobile sidebar off-canvas ===== */
@media (max-width: 991px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(10,20,40,.45); z-index: 1030;
  }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .topbar-search { display: none; }
}

/* ===== Mobile native-app pattern (Employee Portal, phone widths only) =====
   Sidebar + off-canvas hamburger (above) still handles tablet/desktop for every
   role, including Employee. Below 768px, Employee role additionally gets this
   bottom-tab-bar + rounded-header pattern on the Dashboard, matching common
   native mobile app conventions for the field-worker use case this app targets. */
.mobile-hero-header {
  display: none;
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--blue-700) 100%);
  border-radius: 0 0 28px 28px;
  padding: 18px 20px 26px;
  color: #fff;
  margin: -24px -24px 20px;
}
.mobile-hero-header .row-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-hero-header .avatar-circle { background: rgba(255,255,255,.18); color: #fff; margin-right: 0; }
.mobile-hero-header .hero-title { font-weight: 700; font-size: 1.05rem; }
.mobile-hero-header .icon-btn {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; position: relative;
}
.mobile-hero-header .icon-btn .dot {
  position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-600); border: 2px solid var(--navy-900);
}

.quick-action-grid { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.quick-action-card {
  width: calc(50% - 12px); margin: 6px;
  background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 18px 10px; text-align: center; text-decoration: none; color: inherit;
}
.quick-action-card .qa-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin: 0 auto 10px;
}
.quick-action-card .qa-label { font-weight: 700; font-size: .85rem; color: var(--ink-900); }

.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1050;
  background: #fff; border-top: 1px solid var(--ink-200);
  padding: 6px 0;
}
.mobile-tabbar .tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-500); text-decoration: none; font-size: .68rem; font-weight: 600; padding: 4px 0;
}
.mobile-tabbar .tab-item i { font-size: 1.25rem; margin-bottom: 2px; display: block; }
.mobile-tabbar .tab-item.active { color: var(--blue-600); }

@media (max-width: 767.98px) {
  .mobile-hero-header { display: block; }
  .mobile-tabbar { display: flex; }
  .employee-mobile-nav .topbar { display: none; }
  .employee-mobile-nav .page-body { padding-bottom: 88px; padding-top: 4px; }
}
