/* ==========================================================================
   IFSM Dashboard App Shell
   Loaded only by /login/ and /dashboard/ pages. Reuses the brand tokens
   from style.css (which is loaded first) but is otherwise a distinct
   "internal app" visual language from the public marketing site.
   ========================================================================== */

body.dash-body {
  background: var(--mist);
}

/* ---------- Auth (login) pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 0;
  padding: 2.5rem;
  width: 100%;
  max-width: 26rem;
}
.auth-card .role-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--mist);
  color: var(--navy);
  font-weight: 700;
  font-size: .8rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}
.auth-card h2 { font-size: 1.4rem; margin-bottom: .3rem; }
.auth-card .sub { color: var(--ink-soft); font-size: .88rem; margin-bottom: 1.6rem; }
.auth-card .form-label { font-weight: 600; font-size: .85rem; color: var(--navy); }
.auth-card .form-control {
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: .65rem .85rem;
}
.auth-card .form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,92,63,.12);
}
.auth-links { display: flex; justify-content: space-between; font-size: .85rem; margin: .8rem 0 1.4rem; }
.auth-links a { color: var(--green); font-weight: 600; }
.auth-switch { text-align: center; font-size: .85rem; color: var(--ink-soft); margin-top: 1.4rem; }
.auth-switch a { color: var(--navy); font-weight: 600; }

/* ---------- Dashboard shell ---------- */
.dash-shell { display: flex; min-height: 100vh; }

.dash-sidebar {
  width: 250px;
  flex: none;
  background: var(--navy-deep);
  color: #C9D2E0;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.dash-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 .6rem 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.dash-sidebar .sidebar-brand img { height: 34px; }
.dash-sidebar .sidebar-brand .brand-name { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.dash-sidebar .sidebar-brand .brand-sub { color: #8B96A9; font-size: .68rem; font-weight: 600; }
.dash-sidebar .role-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6C7A93;
  padding: 0 .6rem;
  margin-bottom: .6rem;
}
.dash-nav { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.dash-nav li a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .8rem;
  border-radius: 8px;
  color: #C9D2E0;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: .2rem;
}
.dash-nav li a i { font-size: 1rem; width: 18px; text-align: center; }
.dash-nav li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.dash-nav li a.active { background: var(--green); color: #fff; font-weight: 600; }
.dash-sidebar .sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1rem;
}
.dash-sidebar .sidebar-foot a { color: #C9D2E0; font-size: .85rem; display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; }
.dash-sidebar .sidebar-foot a:hover { color: var(--gold); }

.dash-main { flex: 1; min-width: 0; }

.dash-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.dash-topbar h1 { font-size: 1.25rem; margin: 0; }
.dash-topbar .topbar-user { display: flex; align-items: center; gap: .7rem; }
.dash-topbar .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.dash-topbar .user-name { font-size: .88rem; font-weight: 600; color: var(--navy); }
.dash-topbar .user-role { font-size: .75rem; color: var(--ink-soft); }
.sidebar-toggle-btn { display: none; background: none; border: none; font-size: 1.4rem; color: var(--navy); }

.dash-content { padding: 2rem; }

.preview-banner {
  background: #FFF9E8;
  border: 1px solid #F0DCA0;
  color: #6B531A;
  border-radius: 8px;
  padding: .8rem 1.2rem;
  font-size: .85rem;
  margin-bottom: 1.6rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* Stat cards */
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.4rem;
  height: 100%;
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  margin-bottom: .9rem;
}
.stat-card .stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--navy); }
.stat-card .stat-label { font-size: .82rem; color: var(--ink-soft); }

.dash-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}
.dash-panel h5 { font-size: 1rem; margin-bottom: 1.1rem; }
.dash-panel .table { margin-bottom: 0; font-size: .88rem; }
.dash-panel .table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); border-top: none; }

.status-pill {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
}
.status-pill.ok { background: #E9F0EC; color: var(--green); }
.status-pill.warn { background: #FFF3D6; color: #8A6300; }
.status-pill.due { background: #FDEDED; color: #B3261E; }

/* ---------- Notification bell ---------- */
.notif-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--ink-soft);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-bell:hover { background: var(--mist); color: var(--navy); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: #B3261E;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(20,31,51,.12);
}
.notif-dropdown-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: .88rem;
  color: var(--navy);
  position: sticky; top: 0;
  background: #fff;
}
.btn-link-sm {
  background: none; border: none;
  color: var(--green);
  font-size: .78rem;
  font-weight: 600;
  padding: 0;
}
.notif-empty { padding: 1.5rem 1rem; font-size: .85rem; color: var(--ink-soft); text-align: center; }
.notif-item {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.notif-item:hover { background: var(--mist); }
.notif-item.is-unread { background: #F0F6F3; }
.notif-item.is-unread .notif-title::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.notif-title { font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: .15rem; }
.notif-msg { font-size: .8rem; color: var(--ink-soft); margin-bottom: .2rem; }
.notif-time { font-size: .72rem; color: #9AA5B5; }

@media (max-width: 991.98px) {
  .dash-sidebar {
    position: fixed;
    left: -270px;
    z-index: 1050;
    transition: left .2s ease;
    box-shadow: 0 0 30px rgba(0,0,0,.25);
  }
  .dash-sidebar.open { left: 0; }
  .sidebar-toggle-btn { display: inline-block; }
  .dash-content { padding: 1.2rem; }
  .dash-topbar { padding: 1rem 1.2rem; }
  .notif-dropdown { width: 290px; }
}

/* Workspace pages: shared spacing and responsive tables. Brand colours are inherited. */
.dash-content > .dash-panel { margin-bottom: 1.5rem; }
.dash-content .form-control, .dash-content .form-select { min-height: 2.5rem; }
.dash-content .table td, .dash-content .table th { vertical-align: middle; }
.dash-content .table td { overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .dash-content .table-responsive { overflow-x: auto; }
  .dash-content .table { min-width: 520px; }
  .dash-content .d-flex.flex-wrap { align-items: flex-start; }
}

.dash-panel{min-width:0}.dash-panel input[type=file]{max-width:100%}.table-responsive{max-width:100%;overflow-x:auto}.dash-panel .d-flex{flex-wrap:wrap}.dash-panel td{overflow-wrap:anywhere}@media(max-width:575.98px){.dash-panel{padding:1rem}.dash-panel .form-control,.dash-panel .form-select{font-size:16px}.dash-panel .btn{white-space:normal}.dash-panel form.d-flex{gap:.5rem!important}.dash-panel form.d-flex input[type=file]{width:100%;max-width:100%!important}}
