/* ============================================
   TETRA Bestelapplicatie - Design System
   Black / White / Red color scheme
   ============================================ */

:root {
    --red: #cc0000;
    --red-dark: #aa0000;
    --red-light: #ffeeee;
    --black: #111111;
    --white: #ffffff;
    --gray-lightest: #fafafa;
    --gray-light: #f5f5f5;
    --gray-mid: #e0e0e0;
    --gray: #c0c0c0;
    --gray-dark: #666666;
    --gray-darker: #444444;
    --green: #1a7f3c;
    --green-light: #eaf7ee;
    --orange: #d46c00;
    --orange-light: #fff3e0;
    --blue: #0055aa;
    --blue-light: #e8f0fa;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;

    --border-radius: 6px;
    --border-radius-sm: 4px;
    --border-radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);

    --nav-height: 60px;
    --transition: 150ms ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gray-light);
    color: var(--black);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--red);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    background: var(--gray-light);
    border: 1px solid var(--gray-mid);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.88em;
    color: var(--black);
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.navbar-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
}

.brand-link:hover {
    text-decoration: none;
    color: var(--red);
}

.brand-icon {
    display: flex;
    align-items: center;
}

/* ===== HEROICONS ===== */
.icon {
    width: 1.25em;
    height: 1.25em;
    display: inline-block;
    vertical-align: -0.25em;
    flex-shrink: 0;
}
.icon-sm {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}
.icon-lg {
    width: 1.5em;
    height: 1.5em;
    vertical-align: -0.35em;
}
.icon-xl {
    width: 3rem;
    height: 3rem;
    vertical-align: 0;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
}

.nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav-link.active {
    color: var(--white);
    background: var(--red);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.notification-bell {
    position: relative;
    font-size: 1.1rem;
    padding: 0.35rem 0.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: 100vh;
    padding: 1.5rem;
}

.main-content.with-nav {
    margin-top: var(--nav-height);
    padding: 2rem 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== AUTH PAGES ===== */
.auth-body {
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}
.auth-logo .icon-xl {
    color: var(--blue);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--gray-dark);
    font-size: 0.9rem;
}

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

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--gray-dark);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--red);
}

.auth-separator {
    margin: 0 0.5rem;
    color: var(--gray);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-family);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    line-height: 1.2;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--black);
    border-color: var(--gray-mid);
}

.btn-outline:hover {
    background: var(--gray-light);
    border-color: var(--gray);
    color: var(--black);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-success {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.btn-success:hover {
    background: #145e2d;
    color: var(--white);
}

.btn-warning {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
}

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

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-red {
    background: var(--red);
    color: var(--white);
}

.badge-green {
    background: var(--green);
    color: var(--white);
}

.badge-orange {
    background: var(--orange);
    color: var(--white);
}

.badge-blue {
    background: var(--blue);
    color: var(--white);
}

.badge-gray {
    background: var(--gray-mid);
    color: var(--gray-darker);
}

.badge-xs {
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
}

/* Device status badges */
.badge-status-actief {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #b3dfc3;
}

.badge-status-wacht_op_goedkeuring {
    background: var(--orange-light);
    color: var(--orange);
    border: 1px solid #ffd699;
}

.badge-status-goedgekeurd {
    background: var(--blue-light);
    color: var(--blue);
    border: 1px solid #aac5e8;
}

.badge-status-afgekeurd {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid #ffbbbb;
}

/* ===== ALERTS / FLASH MESSAGES ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
    position: relative;
}

.alert-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0.2rem;
}

.alert-close:hover { opacity: 1; }

.alert-success {
    background: var(--green-light);
    color: var(--green);
    border-left-color: var(--green);
}

.alert-error {
    background: var(--red-light);
    color: var(--red);
    border-left-color: var(--red);
}

.alert-warning {
    background: var(--orange-light);
    color: var(--orange);
    border-left-color: var(--orange);
}

.alert-info {
    background: var(--blue-light);
    color: var(--blue);
    border-left-color: var(--blue);
}

.alert-activation {
    padding: 1.25rem;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    word-break: break-all;
}

/* ===== FORMS ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-darker);
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--gray-mid);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-family: var(--font-family);
    color: var(--black);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.form-control-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-dark);
}

.form-help-text {
    font-size: 0.88rem;
    color: var(--gray-dark);
    line-height: 1.6;
}

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

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.required {
    color: var(--red);
}

/* Checkbox & Radio */
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.checkbox-label input, .radio-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--red);
    cursor: pointer;
    flex-shrink: 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-check {
    flex-direction: row;
    align-items: center;
}

/* ===== PASSWORD REQUIREMENTS ===== */
.password-requirements {
    background: var(--gray-lightest);
    border: 1px solid var(--gray-mid);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
}

.req-title {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--gray-darker);
}

.req-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.req-list li {
    color: var(--gray-dark);
    padding-left: 1rem;
    position: relative;
}

.req-list li::before {
    content: '○';
    position: absolute;
    left: 0;
}

.req-list li.req-met {
    color: var(--green);
}

.req-list li.req-met::before {
    content: '●';
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-mid);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-mid);
    background: var(--gray-lightest);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.p-0 { padding: 0; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.88rem;
}

.data-table th {
    background: var(--black);
    color: var(--white);
    padding: 0.7rem 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.data-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--gray-mid);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--gray-lightest);
}

.data-table tbody tr.row-special {
    background: rgba(204, 0, 0, 0.03);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

/* ===== PAGE LAYOUT ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

.page-subtitle {
    color: var(--gray-dark);
    margin: 0;
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== DASHBOARD ===== */
.event-banner {
    background: var(--black);
    color: var(--white);
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-name {
    font-weight: 700;
    font-size: 1rem;
}

.event-deadline {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.event-locks {
    display: flex;
    gap: 0.5rem;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-mid);
    border-left: 4px solid var(--gray-mid);
    text-align: center;
}

.stat-card-red {
    border-left-color: var(--red);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--black);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-orange { color: var(--orange); }
.stat-red { color: var(--red); }

.stat-label {
    font-size: 0.82rem;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 0.2rem;
}

.dashboard-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-mid);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.approval-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.approval-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: var(--gray-lightest);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-mid);
    gap: 1rem;
}

.approval-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.85rem;
}

.activity-time {
    color: var(--gray-dark);
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 70px;
}

.activity-user {
    font-weight: 600;
    color: var(--black);
    min-width: 100px;
}

.activity-action {
    color: var(--gray-darker);
}

/* ===== APPROVALS ===== */
.approval-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.approval-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-mid);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.approval-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.approval-device-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.approval-issi {
    font-size: 0.9rem;
}

.approval-alias {
    font-size: 1.05rem;
}

.approval-requester {
    font-size: 0.85rem;
    color: var(--gray-dark);
}

.approval-reason {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.approval-change-reason {
    font-size: 0.85rem;
    color: var(--gray-darker);
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--orange-light);
    border-radius: var(--border-radius-sm);
}

.approval-groups {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.badge-special {
    margin-left: 0.2rem;
}

.approval-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-mid);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.6rem 1.25rem;
    color: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.tab:hover {
    color: var(--black);
    text-decoration: none;
}

.tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

/* ===== GROUPS ===== */
.group-search-container {
    border: 1.5px solid var(--gray-mid);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.group-search-container .form-control-sm {
    border: none;
    border-bottom: 1px solid var(--gray-mid);
    border-radius: 0;
}

.group-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.group-item {
    padding: 0.35rem 0.5rem;
    border-radius: var(--border-radius-sm);
}

.group-item:hover {
    background: var(--gray-lightest);
}

.group-special {
    background: rgba(204, 0, 0, 0.04);
}

.toggle-switch { display: inline-block; }

.toggle-btn {
    border: none;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle-on {
    background: var(--red);
    color: var(--white);
}

.toggle-off {
    background: var(--gray-mid);
    color: var(--gray-darker);
}

/* ===== CONTRACTORS ===== */
.contractor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.contractor-card .card-header {
    padding: 1rem 1.25rem;
}

.contractor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.contractor-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.contractor-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    margin-bottom: 0.1rem;
}

.stat-item .stat-label {
    font-size: 0.75rem;
}

.contractor-users {
    margin-bottom: 0.75rem;
}

.contractor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contractor-section {
    border-bottom: 1px solid var(--gray-mid);
    padding-bottom: 1.5rem;
}

/* ===== EXPORT ===== */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.export-option h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.contractor-export-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.export-contractor-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--gray-lightest);
    border: 1px solid var(--gray-mid);
    border-radius: var(--border-radius);
}

.export-info {
    border-top: 1px solid var(--gray-mid);
    padding-top: 1rem;
}

.export-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-list {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--gray-dark);
    line-height: 1.8;
}

/* ===== SETTINGS ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

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

.info-table tr td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.info-label {
    color: var(--gray-dark);
    font-weight: 600;
    width: 120px;
}

/* ===== NOTIFICATIONS ===== */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-mid);
    overflow: hidden;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-mid);
    transition: background var(--transition);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--gray-lightest);
}

.notification-unread {
    background: #fff8f8;
    border-left: 3px solid var(--red);
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--gray-dark);
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--black);
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.notification-time {
    font-size: 0.78rem;
    color: var(--gray-dark);
}

.notification-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-dialog {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-lg {
    max-width: 680px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-mid);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-dark);
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--black);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--gray-mid);
}

/* ===== MISC ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--gray-mid);
}

.empty-icon {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    color: var(--gray-mid);
}

.empty-state p {
    color: var(--gray-dark);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.text-muted { color: var(--gray-dark); }
.text-small { font-size: 0.82rem; }
.text-red { color: var(--red); }

.tooltip-icon {
    cursor: help;
}

.device-info-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--gray-lightest);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--gray-mid);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-light); }
::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .main-content.with-nav {
        padding: 1rem;
    }
    .navbar-menu {
        display: none;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .contractor-cards {
        grid-template-columns: 1fr;
    }
}
