﻿/* theme.css (v16 structure + original dev look)
   - Tailwind provides the bulk of styling.
   - This file keeps v16 layout classnames working (grid/card/table-wrap/etc.)
*/

.container{ width: 100%; }

/* layout */
.grid{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

/* cards */
.card{
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  border: 1px solid rgba(17,24,39,.06);
  overflow: hidden;
}
.card .hd{
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(17,24,39,.08);
}
.card .hd h2{
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #111827;
}
.card .bd{
  padding: 1.25rem;
}
.hint{ color: #6b7280; font-size: .875rem; }

/* form */
.field{ margin-bottom: .9rem; }
label{ display:block; font-weight:700; color:#374151; margin-bottom:.35rem; }
.input, select, textarea{
  width: 100%;
  border: 1px solid rgba(17,24,39,.15);
  border-radius: .6rem;
  padding: .6rem .75rem;
  background: #fff;
  outline: none;
}
textarea{ min-height: 110px; }
.form-row{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
@media (max-width: 720px){
  .form-row{ grid-template-columns: 1fr; }
}

/* lists */
.list{ border:1px solid rgba(17,24,39,.10); border-radius:.75rem; overflow:hidden; background:#fff; }
.list .item{ padding:.75rem .9rem; border-top:1px solid rgba(17,24,39,.08); }
.list .item:first-child{ border-top:none; }
.list .name{ font-weight:800; color:#111827; }
.list .sub{ color:#6b7280; font-size:.875rem; margin-top:.1rem; }

/* tables */
.table-wrap{ border:1px solid rgba(17,24,39,.10); border-radius:.75rem; overflow:auto; background:#fff; }
table{ width:100%; border-collapse: collapse; }
th, td{ padding:.75rem .85rem; border-top:1px solid rgba(17,24,39,.08); vertical-align: top; }
thead th{ border-top:none; background:#f3f4f6; color:#374151; font-size:.8rem; text-transform: uppercase; letter-spacing:.03em; }
.money{ font-variant-numeric: tabular-nums; }

/* buttons */
.footer-bar{
  padding: .9rem 1.25rem;
  border-top: 1px solid rgba(17,24,39,.08);
  display:flex;
  justify-content:flex-end;
  gap:.6rem;
  background:#fff;
}
.btn{
  border: 1px solid rgba(17,24,39,.15);
  border-radius: .65rem;
  padding: .55rem .85rem;
  font-weight: 800;
  background: #fff;
  color: #111827;
  cursor: pointer;
}
.btn.primary{
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.btn:hover{ filter: brightness(.98); }
.pill{
  display:inline-block;
  padding:.2rem .6rem;
  border-radius:999px;
  background:#e5e7eb;
  color:#111827;
  font-weight:800;
  font-size:.75rem;
}


/* Dashboard metric cards */
.dash-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 1020px){
  .dash-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .dash-grid{ grid-template-columns: 1fr; }
}
.metric{
  display:block;
  text-decoration:none;
  color: inherit;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,.06);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  padding: 0.95rem 1rem;
}
.metric:hover{ filter: brightness(.99); }
.metric .kicker{
  color:#6b7280;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .02em;
}
.metric .value{
  font-weight: 950;
  font-size: 22px;
  margin-top: 6px;
  color:#111827;
}
.metric .hint2{
  margin-top: 6px;
  color:#6b7280;
  font-size: 12px;
}

/* Utility: full width card inside .grid */
.full-span{ grid-column: 1 / -1; }


/* Bootstrap-like helpers (for full-width table sections) */
.row{ display:flex; flex-wrap:wrap; margin-left:-0.5rem; margin-right:-0.5rem; }
.col-12{ flex:0 0 100%; max-width:100%; padding-left:0.5rem; padding-right:0.5rem; }

/* Authenticated application navigation */
.app-nav {
  position: relative;
  overflow: visible;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.app-nav-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.app-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.app-brand img {
  display: block;
  width: auto;
  height: 4rem;
  object-fit: contain;
}

.app-mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #374151;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 0.65rem;
}

.app-menu-shell {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-primary-menu {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.app-account-menu {
  flex: 0 0 auto;
  margin-left: auto;
  color: #4b5563;
  font-size: 0.875rem;
  text-align: right;
  white-space: nowrap;
}

.app-account-logout {
  margin-left: 0.75rem;
  color: #dc2626;
  font-weight: 700;
  text-decoration: none;
}

.app-account-logout:hover,
.app-account-logout:focus-visible {
  text-decoration: underline;
  outline: none;
}

.app-menu-group {
  position: relative;
  flex: 0 0 auto;
}

.app-menu-trigger,
.app-menu-link {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  padding: 0.5rem 0.65rem;
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-menu-link:hover,
.app-menu-link:focus-visible,
.app-menu-trigger:hover,
.app-menu-trigger:focus-visible,
.app-menu-group.is-open > .app-menu-trigger,
.app-menu-link.is-active,
.app-menu-trigger.is-active {
  background: #eff6ff;
  color: #1e40af;
  outline: none;
}

.app-menu-trigger:focus-visible,
.app-menu-link:focus-visible,
.app-menu-dropdown a:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.app-menu-chevron {
  display: block;
  flex: 0 0 14px;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
  transition: transform 150ms ease;
}

.app-menu-group.is-open .app-menu-chevron {
  transform: rotate(180deg);
}

.app-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1000;
  min-width: 13rem;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 0.55rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.app-menu-dropdown[hidden] {
  display: none !important;
}

.app-menu-dropdown a {
  display: block;
  padding: 0.7rem 0.85rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.app-menu-dropdown a:hover,
.app-menu-dropdown a:focus-visible,
.app-menu-dropdown a.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  outline: none;
}

.app-org-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e9d5ff;
  border-radius: 0.5rem;
  background: #faf5ff;
}

.app-org-banner-text {
  min-width: 0;
  color: #581c87;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.app-org-banner-label {
  font-weight: 700;
}

.app-org-banner-form {
  flex: 0 0 auto;
}

.app-org-banner-button {
  border: 1px solid #d8b4fe;
  border-radius: 0.45rem;
  background: #fff;
  padding: 0.4rem 0.75rem;
  color: #6b21a8;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.app-org-banner-button:hover,
.app-org-banner-button:focus-visible {
  background: #f3e8ff;
  outline: none;
}

@media (min-width: 768px) {
  .app-menu-shell.hidden {
    display: flex !important;
  }
}

@media (max-width: 767px) {
  .app-nav-row {
    flex-wrap: wrap;
  }

  .app-mobile-toggle {
    display: inline-flex;
    align-items: center;
  }

  .app-menu-shell {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .app-menu-shell:not(.hidden) {
    display: flex;
  }

  .app-menu-shell.hidden {
    display: none !important;
  }

  .app-primary-menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .app-menu-link,
  .app-menu-trigger {
    width: 100%;
    justify-content: space-between;
    white-space: normal;
  }

  .app-menu-group {
    width: 100%;
  }

  .app-menu-dropdown {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 0.2rem;
    border: 0;
    border-left: 3px solid #bfdbfe;
    border-radius: 0;
    box-shadow: none;
  }

  .app-menu-dropdown a {
    padding-left: 1.25rem;
    white-space: normal;
  }

  .app-account-menu {
    width: 100%;
    margin-left: 0;
    text-align: left;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-menu-chevron {
    transition: none;
  }
}

