/*
 * Desktop specific stylesheet for FireDoorApp
 *
 * This file defines a polished SaaS‑style look for screens wider than
 * 768px. It starts by importing the default mobile‑first stylesheet
 * (style.css) and then overrides variables, spacing and layout for
 * a more spacious, desktop‑oriented design. By importing the base
 * stylesheet at the top you inherit all existing component styles
 * (forms, tables, etc.), ensuring full functionality while allowing
 * you to selectively override what needs to change for desktop.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
}

/* Installed desktop app: use a branded scrollbar (feels less like a browser tab). */
@media (display-mode: standalone), (display-mode: fullscreen) {
  :root {
    --app-scrollbar-track: rgba(0, 0, 0, 0);
    --app-scrollbar-thumb: color-mix(in srgb, var(--brand, #e6561e) 55%, rgba(15, 23, 42, 0.28));
    --app-scrollbar-thumb-hover: color-mix(in srgb, var(--brand, #e6561e) 70%, rgba(15, 23, 42, 0.3));
    --app-scrollbar-thumb-active: color-mix(in srgb, var(--brand, #e6561e) 82%, rgba(15, 23, 42, 0.3));
  }

  :where(html, body) {
    scrollbar-width: thin;
    scrollbar-color: var(--app-scrollbar-thumb) var(--app-scrollbar-track);
  }

  :where(*) {
    scrollbar-width: thin;
    scrollbar-color: var(--app-scrollbar-thumb) var(--app-scrollbar-track);
  }

  :where(*)::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  :where(*)::-webkit-scrollbar-track {
    background: var(--app-scrollbar-track);
  }

  :where(*)::-webkit-scrollbar-thumb {
    background-color: var(--app-scrollbar-thumb);
    border-radius: 999px;
    border: 3px solid rgba(0, 0, 0, 0);
    background-clip: content-box;
  }

  :where(*)::-webkit-scrollbar-thumb:hover {
    background-color: var(--app-scrollbar-thumb-hover);
  }

  :where(*)::-webkit-scrollbar-thumb:active {
    background-color: var(--app-scrollbar-thumb-active);
  }
}

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

.app-shell {
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

/* Desktop never uses the hamburger nav affordance */
.mobile-nav-trigger,
.mobile-nav-overlay {
  display: none !important;
}

/* Sidebar redesigned for desktop */
.sidebar {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  color: var(--ink-2);
  padding: 12px 10px 20px;
  border-radius: 0;
  box-shadow: none;
  border-right: 1px solid var(--rule);
}

.sidebar::after {
  display: none;
}

.sidebar h1 {
  font-size: 1.35rem;
  color: var(--brand);
}

.sidebar-brand {
  display: none;
}

.sidebar-nav {
  gap: 0;
}

.sidebar-nav__list {
  gap: 0;
}

/* Navigation list styles */
.sidebar-nav__link {
  padding: 7px 10px;
  gap: 9px;
  font-size: 13px;
}

.sidebar-nav__link:hover,
.sidebar-nav__link:focus-visible {
  transform: none;
  box-shadow: none;
}

.sidebar-nav__footer {
  padding-top: 6px;
}

.sidebar-nav__logout-button {
  font-size: 0.9rem;
}

/* Responsive rules migrated from style.css (desktop-only). */
@media (min-width: 1024px) {
  .sidebar.sidebar--collapsed {
    width: 84px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar.sidebar--collapsed:hover,
  .sidebar.sidebar--collapsed.sidebar--expanded {
    width: var(--sidebar-expanded-width, 240px);
    padding-left: var(--sidebar-padding-x, 24px);
    padding-right: var(--sidebar-padding-x, 24px);
  }

  .sidebar.sidebar--collapsed .sidebar-brand {
    justify-content: center;
  }

  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__link {
    padding: 10px;
    justify-content: center;
  }

  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__link::before {
    display: none;
  }

  .sidebar.sidebar--collapsed:hover .sidebar-nav__link,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-nav__link {
    padding: var(--sidebar-link-padding);
    justify-content: flex-start;
  }

  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__icon {
    margin: 0;
  }

  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__label,
  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-brand h1,
  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-brand img,
  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__divider,
  .sidebar.sidebar--collapsed:not(.sidebar--expanded) .sidebar-nav__footer {
    opacity: 0;
    visibility: hidden;
    width: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar.sidebar--collapsed:hover .sidebar-nav__label,
  .sidebar.sidebar--collapsed:hover .sidebar-brand h1,
  .sidebar.sidebar--collapsed:hover .sidebar-brand img,
  .sidebar.sidebar--collapsed:hover .sidebar-nav__divider,
  .sidebar.sidebar--collapsed:hover .sidebar-nav__footer,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-nav__label,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-brand h1,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-brand img,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-nav__divider,
  .sidebar.sidebar--collapsed.sidebar--expanded .sidebar-nav__footer {
    opacity: 1;
    visibility: visible;
    width: auto;
    pointer-events: auto;
  }
}

@media (min-width: 1024px) {
  .page-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .page-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
  }
}

@media (min-width: 768px) {
  .door-detail-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .door-detail-specs {
    justify-content: flex-end;
  }
}

@media (min-width: 769px) {
  .card--wizard .form-progress {
    display: none;
  }



/* Main content area */
.content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  padding: 0 28px 28px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Section heading styling */
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

/* Top bar on desktop: white bar with subtle shadow */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e6e8ed;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-user p {
  margin: 0;
  font-size: 0.9rem;
  color: #6a6f7c;
}

html[data-theme="dark"] .top-bar {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .top-bar-user p {
  color: var(--text-muted, rgba(148, 163, 184, 0.95));
}

.top-bar-logo img {
  max-height: 28px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* Cards grid: more generous spacing on desktop */
.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--card-bg, #ffffff);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(17, 17, 17, 0.06);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 6px 24px rgba(17, 17, 17, 0.1);
}

.card h3 {
  margin: 0 0 16px 0;
  font-size: 1.2rem;
}

.stats {
  font-size: 2.2rem;
  font-weight: 700;
}

.btn--tiny {
  padding: 4px 10px;
  font-size: 0.78rem;
  min-height: 30px;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
  vertical-align: top;
}

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

thead th {
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.65);
}

tbody tr:hover {
  background: rgba(239, 246, 255, 0.75);
}

tbody tr:focus-within {
  background: rgba(224, 231, 255, 0.55);
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.28);
}

html[data-theme="dark"] table,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-responsive {
  border-color: var(--border);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] thead th {
  background: rgba(15, 23, 42, 0.9);
  color: rgba(226, 232, 240, 0.9);
  border-bottom-color: rgba(148, 163, 184, 0.26);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.48);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(30, 41, 59, 0.65);
}

html[data-theme="dark"] tbody tr:focus-within {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.22);
}

.table-wrapper,
.table-responsive {
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.table-wrapper > table,
.table-responsive > table {
  border-radius: 0;
  box-shadow: none;
  border: 0;
}

.table-wrapper--sticky {
  max-height: min(70vh, 720px);
  overflow: auto;
}


.table-wrapper--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (min-width: 1025px) {
  .table--dividers td + td,
  .table--dividers th + th {
    border-left: 1px solid rgba(226, 232, 240, 0.65);
  }
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pass {
  background: rgba(10, 135, 84, 0.15);
  color: var(--success);
}

.status-fail {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}
.status-pill--success {
  background: rgba(10, 135, 84, 0.15);
  color: var(--success);
}
.status-pill--muted {
  background: #f3f4f6;
  color: #475467;
}

html[data-theme="dark"] .status-pill--muted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

/* Misc components reused from mobile style */
/* We include only what's necessary for desktop, other components will fall back to defaults */
.card--wizard .form-section {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.card--wizard .form-section:nth-of-type(even) {
  background: #f4f7ff;
}

html[data-theme="dark"] .card--wizard .form-section {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .card--wizard .form-section:nth-of-type(even) {
  background: rgba(30, 41, 59, 0.65);
}

.card.card--wizard {
  padding: 32px;
  border: none;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.card.card--wizard h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.card.card--wizard p.text-muted {
  margin-bottom: 24px;
}
body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2110;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[hidden] {
    display: none;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal__dialog {
	    position: relative;
	    z-index: 1;
	    background: var(--card);
	    border-radius: 16px;
	    width: min(960px, 90%);
	    max-height: 90vh;
	    overflow: auto;
	    padding: 24px;
	    box-shadow: 0 25px 65px rgba(9, 41, 57, 0.18);
		}

.modal__dialog--narrow {
    width: min(520px, 90%);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pricing-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.pricing-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pricing-table__actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 34px;
}

.text-danger {
    color: #b42318;
}

.pricing-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pricing-form__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.pricing-reason-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.pricing-reason-add input {
    flex: 1;
    min-width: 0;
}

.pricing-import-label {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.pricing-import-label input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand, #0052cc);
    margin: 0 0 0.35rem 0;
}
