/* ==========================================================================
   CloudSec - Security Monitoring Dashboard Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d2d2d;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #4A9FCC;
    text-decoration: none;
}

a:hover {
    color: #2980B9;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
    color: #16213e;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: #424242;
}

p {
    margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.login-container h1 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-container p {
    text-align: center;
    color: #757575;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

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

.login-container .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #757575;
}

/* --------------------------------------------------------------------------
   App Layout - Grid: Sidebar + Main Content
   -------------------------------------------------------------------------- */

.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #c8ccd8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 0;
}

.sidebar-header .sidebar-subtitle {
    font-size: 0.7rem;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.15rem;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */

.nav-links {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    color: #a8b2d1;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.nav-links a.active,
.nav-links li.active a {
    background: rgba(255, 127, 79, 0.12);
    color: #FF7F4F;
    border-left-color: #FF7F4F;
    font-weight: 600;
}

.nav-links a .nav-icon {
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Sidebar Nav Section Dividers
   -------------------------------------------------------------------------- */

.nav-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #5a6380;
    padding: 1rem 1.25rem 0.35rem;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Sidebar Footer
   -------------------------------------------------------------------------- */

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
}

.sidebar-footer .user-name {
    color: #c8ccd8;
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-role {
    color: #5a6380;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.sidebar-footer a {
    color: #8892b0;
    font-size: 0.8rem;
}

.sidebar-footer a:hover {
    color: #FF7F4F;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */

.main-content {
    grid-column: 2;
    padding: 1.75rem 2rem;
    background: #f5f5f5;
    min-height: 100vh;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.page-header p {
    color: #757575;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: #757575;
    margin-bottom: 1rem;
}

.breadcrumb li::after {
    content: "/";
    margin-left: 0.4rem;
    color: #bbb;
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: #4A9FCC;
}

.breadcrumb a:hover {
    color: #2980B9;
    text-decoration: underline;
}

.breadcrumb li:last-child {
    color: #424242;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.card-header h2,
.card-header h3 {
    margin-bottom: 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #16213e;
    margin-bottom: 0;
}

.card-body {
    font-size: 0.9rem;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.82rem;
    color: #757575;
}

/* --------------------------------------------------------------------------
   Tenant Grid
   -------------------------------------------------------------------------- */

.tenant-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Tenant Card
   -------------------------------------------------------------------------- */

.tenant-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.tenant-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tenant-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #eee;
}

.tenant-card-header h3 {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.tenant-card-body {
    padding: 1.1rem;
}

.tenant-card-footer {
    padding: 0.65rem 1.1rem;
    background: #fafafa;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #757575;
}

/* --------------------------------------------------------------------------
   Posture Score Display
   -------------------------------------------------------------------------- */

.posture-score {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.posture-score .score-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #757575;
    margin-top: 0.2rem;
}

.score-good {
    color: #2e7d32;
}

.score-warning {
    color: #e65100;
}

.score-danger {
    color: #d32f2f;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

thead th {
    background: #16213e;
    color: #fff;
    padding: 0.6rem 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

thead th:first-child {
    border-radius: 4px 0 0 0;
}

thead th:last-child {
    border-radius: 0 4px 0 0;
}

tbody td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: #f8f9fa;
}

tbody tr:hover {
    background: #f0f4f8;
}

/* Findings table severity column styling */
.findings-table .severity-critical {
    color: #d32f2f;
    font-weight: 700;
}

.findings-table .severity-high {
    color: #e65100;
    font-weight: 600;
}

.findings-table .severity-medium {
    color: #f9a825;
    font-weight: 600;
}

.findings-table .severity-low {
    color: #2e7d32;
    font-weight: 600;
}

.findings-table .severity-info {
    color: #1565c0;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    background: #fff;
    color: #424242;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: #f0f0f0;
    border-color: #999;
    text-decoration: none;
    color: #424242;
}

.btn:active {
    background: #e4e4e4;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4A9FCC;
    border-color: #3a8ab5;
    color: #fff;
}

.btn-primary:hover {
    background: #2980B9;
    border-color: #2471a3;
    color: #fff;
}

.btn-primary:active {
    background: #2471a3;
}

.btn-danger {
    background: #d32f2f;
    border-color: #b71c1c;
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
    border-color: #9a0007;
    color: #fff;
}

.btn-danger:active {
    background: #9a0007;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Alerts / Notification Banners
   -------------------------------------------------------------------------- */

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    border: 1px solid transparent;
}

.alert-error {
    background: #fce4ec;
    border-color: #ef9a9a;
    color: #b71c1c;
}

.alert-success {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1b5e20;
}

.alert-warning {
    background: #fff8e1;
    border-color: #ffe082;
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
}

/* --------------------------------------------------------------------------
   Severity Badges
   -------------------------------------------------------------------------- */

.badge-critical,
.badge-high,
.badge-medium,
.badge-low,
.badge-info {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-critical {
    background: #fce4ec;
    color: #d32f2f;
}

.badge-high {
    background: #fff3e0;
    color: #e65100;
}

.badge-medium {
    background: #fffde7;
    color: #f9a825;
}

.badge-low {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* --------------------------------------------------------------------------
   Platform Tags
   -------------------------------------------------------------------------- */

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-google {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-microsoft {
    background: #e3f2fd;
    color: #1565c0;
}

.tag-both {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* --------------------------------------------------------------------------
   Status Indicators
   -------------------------------------------------------------------------- */

.status-active,
.status-paused,
.status-error,
.status-pending {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-paused {
    background: #fff3e0;
    color: #e65100;
}

.status-error {
    background: #fce4ec;
    color: #d32f2f;
}

.status-pending {
    background: #eceff1;
    color: #546e7a;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #424242;
    margin-bottom: 0.3rem;
}

.form-group .form-hint {
    display: block;
    font-size: 0.78rem;
    color: #757575;
    margin-top: 0.2rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.5;
    color: #2d2d2d;
    background: #fff;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4A9FCC;
    box-shadow: 0 0 0 2px rgba(74, 159, 204, 0.2);
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

select {
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.4rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-error {
    color: #d32f2f;
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   Filter Bar
   -------------------------------------------------------------------------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 0 1 auto;
    min-width: 150px;
}

.filter-bar label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #757575;
    margin-bottom: 0.25rem;
}

.filter-bar select,
.filter-bar input {
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
}

.filter-bar .btn {
    align-self: flex-end;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #424242;
    text-decoration: none;
    font-size: 0.82rem;
}

.pagination a:hover {
    background: #f0f0f0;
    border-color: #bbb;
    text-decoration: none;
}

.pagination .active {
    background: #4A9FCC;
    border-color: #4A9FCC;
    color: #fff;
    font-weight: 600;
}

.pagination .disabled {
    color: #bbb;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .pagination-info {
    margin-left: 0.75rem;
    color: #757575;
    font-size: 0.8rem;
    border: none;
    min-width: auto;
    height: auto;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Trend Chart Container
   -------------------------------------------------------------------------- */

.trend-chart {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    min-height: 200px;
    position: relative;
}

.trend-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.trend-chart .chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #424242;
    margin-bottom: 0.75rem;
}

.trend-chart .chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: #999;
    font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Scan Progress
   -------------------------------------------------------------------------- */

.scan-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
}

.scan-progress .progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.scan-progress .progress-fill {
    height: 100%;
    background: #4A9FCC;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.scan-progress .progress-fill.progress-running {
    background: linear-gradient(90deg, #4A9FCC 0%, #87CEEB 50%, #4A9FCC 100%);
    background-size: 200% 100%;
    animation: progress-shimmer 1.5s linear infinite;
}

@keyframes progress-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.scan-progress .progress-label {
    font-size: 0.8rem;
    color: #757575;
    white-space: nowrap;
    min-width: 3rem;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #757575;
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state h3 {
    color: #424242;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.empty-state p {
    font-size: 0.88rem;
    max-width: 400px;
    margin: 0 auto 1rem;
}

/* --------------------------------------------------------------------------
   Checkbox Labels & Text Utilities
   -------------------------------------------------------------------------- */

.checkbox-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 400;
    color: #2d2d2d;
    padding: 0.2rem 0;
    cursor: pointer;
}

.text-muted {
    color: #757575;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Setup Instructions (collapsible details/summary)
   -------------------------------------------------------------------------- */

.setup-instructions {
    margin-bottom: 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.setup-instructions summary {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #424242;
    cursor: pointer;
    user-select: none;
}

.setup-instructions summary:hover {
    color: #16213e;
    background: #f0f0f0;
}

.setup-instructions[open] summary {
    border-bottom: 1px solid #e0e0e0;
}

.setup-instructions ol,
.setup-instructions ul {
    padding: 0.75rem 1rem 0.75rem 2.25rem;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.7;
}

.setup-instructions ul {
    list-style: disc;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.setup-instructions li {
    margin-bottom: 0.3rem;
}

.setup-instructions code {
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Utility: Hidden
   -------------------------------------------------------------------------- */

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Detail Row (expandable finding details)
   -------------------------------------------------------------------------- */

.detail-row {
    background: #fafbfc;
    border-left: 3px solid #4A9FCC;
}

.detail-row td {
    padding: 1rem 1.25rem;
}

.detail-row .detail-content {
    font-size: 0.85rem;
}

.detail-row .detail-content dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
}

.detail-row .detail-content dt {
    font-weight: 600;
    color: #424242;
    white-space: nowrap;
}

.detail-row .detail-content dd {
    color: #555;
}

/* --------------------------------------------------------------------------
   JSON Display
   -------------------------------------------------------------------------- */

.json-display {
    font-family: 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre;
    margin: 0.5rem 0;
    border: 1px solid #2d2d5e;
}

.json-display .json-key {
    color: #87CEEB;
}

.json-display .json-string {
    color: #a5d6a7;
}

.json-display .json-number {
    color: #FFC299;
}

.json-display .json-boolean {
    color: #FF7F4F;
}

.json-display .json-null {
    color: #757575;
}

/* --------------------------------------------------------------------------
   Summary / Stats Row
   -------------------------------------------------------------------------- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #16213e;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #757575;
    margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   Code & Pre
   -------------------------------------------------------------------------- */

code {
    font-family: 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    background: #f0f0f0;
    padding: 0.12rem 0.35rem;
    border-radius: 3px;
    font-size: 0.84rem;
}

pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0.75rem 0;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* --------------------------------------------------------------------------
   Action Bar (top of content area, above tables etc.)
   -------------------------------------------------------------------------- */

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

.action-bar .action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Mobile Sidebar Toggle
   -------------------------------------------------------------------------- */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    background: #16213e;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet (max-width 1024px) - 2-column tenant grid
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .tenant-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Responsive: Mobile (max-width 768px) - collapse sidebar, stack grids
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        grid-column: 1;
        padding: 1rem;
        padding-top: 3.5rem;
    }

    .tenant-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        min-width: 0;
    }

    table {
        font-size: 0.8rem;
    }

    thead th,
    tbody td {
        padding: 0.4rem 0.5rem;
    }

    .action-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    h1 {
        font-size: 1.4rem;
    }

    .detail-row .detail-content dl {
        grid-template-columns: 1fr;
    }

    .detail-row .detail-content dt {
        margin-top: 0.4rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive: Small mobile (max-width 480px)
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 1.5rem 1.25rem 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .filter-bar .btn,
    .pagination,
    .btn {
        display: none;
    }

    .app-layout {
        grid-template-columns: 1fr;
    }

    .main-content {
        grid-column: 1;
        padding: 0;
        background: #fff;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 10pt;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    table {
        font-size: 8pt;
    }

    thead th {
        background: #333;
        color: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    tbody tr:nth-child(even) {
        background: #f0f0f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .alert {
        border: 1px solid #999;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .breadcrumb {
        display: none;
    }

    .posture-score {
        color: #000;
    }
}
