
:root {
    --app-primary: #1F4E79;
    --app-primary-dark: #163A5B;
    --app-background: #f4f7f6;
    --app-surface: #ffffff;
    --app-surface-alt: #eef3f8;
    --app-border: #d7dee7;
    --app-text: #1f2937;
    --app-muted: #64748b;
    --app-radius: 10px;
    --app-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body[data-theme] {
    background-color: var(--app-background);
    color: var(--app-text);
}

body[data-theme] .navbar-custom {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark)) !important;
    border-bottom-color: var(--app-primary) !important;
}

body[data-theme] .permit-card {
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

body[data-theme] .tab-content-wrapper {
    background: var(--app-surface);
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    box-shadow: var(--app-shadow);
}

body[data-theme] .nav-tabs .nav-link.active {
    color: var(--app-primary);
    border-bottom-color: var(--app-primary);
}

body[data-theme] .nav-tabs .nav-link:hover {
    background-color: var(--app-surface-alt);
}

body[data-theme] .theme-accent {
    color: var(--app-primary) !important;
}

body[data-theme] .theme-surface {
    background-color: var(--app-surface) !important;
}

body[data-theme] .theme-surface-alt {
    background-color: var(--app-surface-alt) !important;
}

body[data-theme] .theme-border {
    border-color: var(--app-border) !important;
}

/* Theme 2: stronger safety-green visual identity while preserving the
   common dashboard markup and permit-specific status/action colors. */
body[data-theme="theme2"] .navbar-custom .navbar-brand {
    letter-spacing: 0.15px;
}

body[data-theme="theme2"] .permit-card {
    border-top: 3px solid var(--app-primary);
    border-left-width: 3px;
}

body[data-theme="theme2"] .tab-content-wrapper {
    border: 1px solid var(--app-border);
}

body[data-theme="theme2"] .table thead th {
    background-color: var(--app-surface-alt) !important;
    color: var(--app-text);
}

body[data-theme="theme2"] .btn-theme-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
}

body[data-theme="theme2"] .btn-theme-primary:hover {
    background-color: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
    color: #fff;
}

/* Shared permit-entry form shell. Applied only to forms explicitly
   marked with class="theme-form" so the verified Hot Work form remains
   untouched by this batch. */
body.theme-form[data-theme="theme2"] .card {
    background-color: var(--app-surface);
    border-color: var(--app-border) !important;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

body.theme-form[data-theme="theme2"] .section-title {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #fff !important;
}

body.theme-form[data-theme="theme2"] .signature-pad-container {
    border-color: var(--app-primary) !important;
    background-color: var(--app-surface);
}

body.theme-form[data-theme="theme2"] .form-control:focus,
body.theme-form[data-theme="theme2"] .form-select:focus {
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(47, 107, 60, 0.15) !important;
}

body.theme-form[data-theme="theme2"] .table thead th,
body.theme-form[data-theme="theme2"] .table-light th {
    background-color: var(--app-surface-alt) !important;
    border-color: var(--app-border) !important;
}

body.theme-form[data-theme="theme2"] .form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

body.theme-form[data-theme="theme2"] .btn-primary {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
}

body.theme-form[data-theme="theme2"] .btn-primary:hover {
    background-color: var(--app-primary-dark) !important;
    border-color: var(--app-primary-dark) !important;
}
