/* ================================
   GLOBAL STYLES & CSS VARIABLES
   ================================ */

:root {
    --primary-color: #df2020;
    --primary-dark: #b91818;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --dark-bg: #1a1a1a;
    --dark-card: #2a2a2a;
    --dark-header: #3a3a3a;
    --dark-text: #e0e0e0;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.2);
    
    /* Light mode defaults */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e9ecef;
}

/* Dark Mode Color Overrides - DEFINED IN dark-mode.css, NOT HERE */
/* DO NOT ADD DARK MODE STYLES HERE - Use dark-mode.css instead */

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

html {
    scroll-behavior: smooth;
    font-size: clamp(14px, 2vw, 16px);
    background-color: var(--bg-primary);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* ================================
   DARK MODE STYLES
   MOVED TO: static/css/dark-mode.css
   DO NOT ADD DARK MODE RULES HERE
   ================================ */

/* All borders */
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* Progress bars */
[data-theme="dark"] .progress {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .progress-bar {
    background-color: var(--primary-color);
}

/* Links in dark mode */
[data-theme="dark"] a {
    color: #ff6b6b;
}

[data-theme="dark"] a:hover {
    color: #ff9999;
}

/* ================================
   TYPOGRAPHY
   ================================ */

h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

h2 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 600;
}

h5 {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 600;
}

h6 {
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    font-size: clamp(14px, 1.2vw, 16px);
    color: var(--text-primary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
[data-theme="dark"] a {
    color: var(--white);
}
 p, span, label, li {
    color: var(--text-primary);
}

[data-theme="dark"] p, [data-theme="dark"] span, [data-theme="dark"] label, [data-theme="dark"] li {
    color: var(--white);
}


/* ================================
   NAVBAR & HEADER
   ================================ */

.navbar-firefighter {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 0.75rem 0;
    box-shadow: var(--box-shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-firefighter .navbar-brand {
    font-weight: 700;
    font-size: clamp(18px, 2.5vw, 24px);
    letter-spacing: 0.5px;
    color: var(--white) !important;
    text-transform: uppercase;
}

.navbar-firefighter .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color var(--transition-speed);
}

.navbar-firefighter .nav-link:hover {
    color: var(--white) !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.btn-theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ================================
   PROFILE PICTURES
   ================================ */

.profile-pic {
    border: 3px solid var(--white);
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.profile-pic:hover {
    transform: scale(1.05);
}

.profile-pic-default {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 4px;
}

/* ================================
   BUTTONS
   ================================ */

.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    font-size: clamp(13px, 1vw, 14px);
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(223, 32, 32, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: clamp(12px, 0.9vw, 13px);
}

/* ================================
   CARDS
   ================================ */

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed);
    background-color: var(--white);
    color: #333;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-4px);
}

[data-theme="dark"] .card {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: var(--dark-header);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}


.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    color:var(--bg-primary)
}

[data-theme="dark"] .card-footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-top-color: #444;
    color: var(--dark-text);
}

/* ================================
   FORMS
   ================================ */

.form-control,
.form-select,
textarea {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: clamp(14px, 1vw, 15px);
    transition: all var(--transition-speed);
    font-family: inherit;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(223, 32, 32, 0.25);
    outline: none;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea {
    background-color: var(--dark-header);
    color: white;
    border-color: #444;
}

[data-theme="dark"] .form-control::placeholder {
    color: #888;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .form-label {
    color: var(--dark-text);
}

/* ================================
   BADGES
   ================================ */

.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: clamp(12px, 0.9vw, 13px);
    font-weight: 600;
    letter-spacing: 0.3px;
}

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

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

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

.badge-warning {
    background-color: var(--warning-color);
    color: #333;
}

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

/* ================================
   ALERTS
   ================================ */

.alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

[data-theme="dark"] .alert {
    border-left-color: var(--primary-color);
}

[data-theme="dark"] .alert-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #86efac;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #fca5a5;
}

/* ================================
   TABLES
   ================================ */
.list-group-item {
    position: relative;
    display: block;
    padding: var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);
    text-decoration: none;
    border: var(--bs-list-group-border-width) solid var(--bs-list-group-border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: #444;
}
.list-group .list-group-flush.active{
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: #444;
}
.list-group-item.active{
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: #444;
}
[data-theme="dark"] .list-group-item.active {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: #444;
}
[data-theme="dark"] .list-group-item {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: #444;
}
[data-theme="dark"].list-group .list-group-flush.active{
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: #444;
}

/* ================================
   MAIN CONTENT & LAYOUT
   ================================ */

main {
    min-height: 100vh;
    padding: 2rem 0;
    background-color: var(--white);
    transition: background-color var(--transition-speed);
}

[data-theme="dark"] main {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* ================================
   CONTAINERS & GRID
   ================================ */

.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.container-fluid {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.col {
    flex: 1 0 0%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ================================
   DROPDOWN MENU
   ================================ */

.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--dark-card);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
    font-size: clamp(14px, 1vw, 15px);
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: #ff6b6b;
    color: var(--white);
}

[data-theme="dark"] .dropdown-item {
    color: var(--dark-text);
}

/* ================================
   MODAL
   ================================ */

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

[data-theme="dark"] .modal-content {
    background-color: var(--dark-card);
    color: var(--dark-text);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ================================
   UTILITY CLASSES
   ================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-muted {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--dark-text) !important;
}
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }

.d-flex {
    display: flex;
}

.d-inline-block {
    display: inline-block;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.rounded {
    border-radius: var(--border-radius);
}

.rounded-circle {
    border-radius: 50%;
}

.shadow {
    box-shadow: var(--box-shadow);
}

.shadow-lg {
    box-shadow: var(--box-shadow-lg);
}

.border {
    border: 1px solid #e9ecef;
}

[data-theme="dark"] .border {
    border-color: #444;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

/* Large screens (≥1200px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .col-lg-1 { flex: 0 0 calc(100% / 12); }
    .col-lg-2 { flex: 0 0 calc(200% / 12); }
    .col-lg-3 { flex: 0 0 calc(300% / 12); }
    .col-lg-4 { flex: 0 0 calc(400% / 12); }
    .col-lg-5 { flex: 0 0 calc(500% / 12); }
    .col-lg-6 { flex: 0 0 calc(600% / 12); }
    .col-lg-7 { flex: 0 0 calc(700% / 12); }
    .col-lg-8 { flex: 0 0 calc(800% / 12); }
    .col-lg-9 { flex: 0 0 calc(900% / 12); }
    .col-lg-10 { flex: 0 0 calc(1000% / 12); }
    .col-lg-11 { flex: 0 0 calc(1100% / 12); }
    .col-lg-12 { flex: 0 0 100%; }
}

/* Medium screens (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .container {
        max-width: 960px;
        margin-left: auto;
        margin-right: auto;
    }

    .col-md-1 { flex: 0 0 calc(100% / 12); }
    .col-md-2 { flex: 0 0 calc(200% / 12); }
    .col-md-3 { flex: 0 0 calc(300% / 12); }
    .col-md-4 { flex: 0 0 calc(400% / 12); }
    .col-md-5 { flex: 0 0 calc(500% / 12); }
    .col-md-6 { flex: 0 0 calc(600% / 12); }
    .col-md-7 { flex: 0 0 calc(700% / 12); }
    .col-md-8 { flex: 0 0 calc(800% / 12); }
    .col-md-9 { flex: 0 0 calc(900% / 12); }
    .col-md-10 { flex: 0 0 calc(1000% / 12); }
    .col-md-11 { flex: 0 0 calc(1100% / 12); }
    .col-md-12 { flex: 0 0 100%; }

    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
}

/* Small screens (480px - 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        margin-left: auto;
        margin-right: auto;
    }

    .col-sm-1 { flex: 0 0 calc(100% / 12); }
    .col-sm-2 { flex: 0 0 calc(200% / 12); }
    .col-sm-3 { flex: 0 0 calc(300% / 12); }
    .col-sm-4 { flex: 0 0 calc(400% / 12); }
    .col-sm-5 { flex: 0 0 calc(500% / 12); }
    .col-sm-6 { flex: 0 0 calc(600% / 12); }
    .col-sm-7 { flex: 0 0 calc(700% / 12); }
    .col-sm-8 { flex: 0 0 calc(800% / 12); }
    .col-sm-9 { flex: 0 0 calc(900% / 12); }
    .col-sm-10 { flex: 0 0 calc(1000% / 12); }
    .col-sm-11 { flex: 0 0 calc(1100% / 12); }
    .col-sm-12 { flex: 0 0 100%; }

    .navbar-expand-lg .navbar-collapse {
        display: none !important;
    }

    .navbar-toggler:not(.collapsed) ~ .navbar-collapse {
        display: block !important;
    }

    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }

    .card {
        margin-bottom: 1rem;
    }
}

/* Extra small screens (360px - 479px) */
@media (max-width: 479px) {
    .container {
        max-width: 100%;
    }

    .col-xs-1 { flex: 0 0 calc(100% / 12); }
    .col-xs-2 { flex: 0 0 calc(200% / 12); }
    .col-xs-3 { flex: 0 0 calc(300% / 12); }
    .col-xs-4 { flex: 0 0 calc(400% / 12); }
    .col-xs-5 { flex: 0 0 calc(500% / 12); }
    .col-xs-6 { flex: 0 0 calc(600% / 12); }
    .col-xs-7 { flex: 0 0 calc(700% / 12); }
    .col-xs-8 { flex: 0 0 calc(800% / 12); }
    .col-xs-9 { flex: 0 0 calc(900% / 12); }
    .col-xs-10 { flex: 0 0 calc(1000% / 12); }
    .col-xs-11 { flex: 0 0 calc(1100% / 12); }
    .col-xs-12 { flex: 0 0 100%; }

    body {
        font-size: 14px;
    }

    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 12px;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 0;
    }

    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
}

/* ================================
   PRINTING
   ================================ */
    /* Terminal Styling */
    .terminal-window {
        background-color: #1e1e1e; 
        color: #cccccc;            
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 13px;
        height: 400px;
        overflow-y: auto;
        padding: 15px;
        white-space: pre-wrap;     
        border-radius: 0 0 5px 5px;
    }

    /* Scrollbar styling */
    .terminal-window::-webkit-scrollbar { width: 8px; }
    .terminal-window::-webkit-scrollbar-track { background: #1e1e1e; }
    .terminal-window::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

    /* Live Badge Animation */
    .blink-me { animation: blinker 1.5s linear infinite; }
    @keyframes blinker { 50% { opacity: 0; } }

    /* Syntax Highlighting Classes */
    .log-header { color: #569cd6; font-weight: bold; } /* Blue */
    .log-safe   { color: #00ff41; font-weight: bold; } /* Green */
    .log-warn   { color: #ffd700; font-weight: bold; } /* Gold */
    .log-fire   { color: #ff3333; font-weight: bold; } /* Red */
    .log-input  { color: #ce9178; }                    
    /* App-like Custom Tweaks */
    .app-card { border-radius: 16px; border: none;}
    .app-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08)!important; }
    .stat-icon { position: absolute; right: -10px; bottom: -15px; font-size: 5rem; opacity: 0.5; transform: rotate(-15deg); }
    .action-card {border-radius: 16px; border: 1px solid rgba(0,0,0,0.08); }
    .action-card:hover { border-color: rgba(0,0,0,0.1); transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08)!important; }
    [data-theme="dark"] .action-card {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: var(--dark-header);
}
    
    /* Sensor List Item */
    .sensor-list-item { transition: all 0.3s ease; border: 1px solid rgba(0,0,0,0.03); }
    .btn-icon-only { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }


    .swipe-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        padding-bottom: 0.5rem;
    }
    .swipe-row::-webkit-scrollbar { display: none; }
    
    .swipe-item {
        flex: 0 0 auto;
        scroll-snap-align: start;
        overflow: hidden;
        border-radius: 12px;
        position: relative;
    }

    /* Floating Action Button (Mobile Only) */
    .fab-btn {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 1050;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    }
    .fab-btn:active { transform: scale(0.9); }

        /* Target standard Django inputs automatically */
    .form-control, select, input[type="text"], input[type="date"], textarea {
        border-radius: 12px !important;
        border: 1.5px solid #e9ecef;
        padding: 0.8rem 1rem;
        width: 100%;
        font-size: 0.95rem;
        display: block;
    }
    
    .form-control:focus, select:focus, input:focus, textarea:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
        outline: none;
    }

    /* Touch-friendly Camera Dropzone */
    .upload-dropzone {
        border: 2px dashed #ffcdd2;
        border-radius: 16px;
        transition: background-color 0.2s ease;
        cursor: pointer;
    }
    .upload-dropzone:active {
        background-color: #ffebee;
    } 
    .upload-dropzone:hover { border-color: #df2020; } 
    /* Sticky Bottom Bar for Mobile */
    @media (max-width: 767px) {
        .sticky-bottom-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 1rem;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
            z-index: 1050;
            border-top-left-radius: 24px;
            border-top-right-radius: 24px;
        }
    }
    
    /* Desktop layout for buttons */
    @media (min-width: 768px) {
        body { padding-bottom: 0; }
        .sticky-bottom-bar {
            background: transparent;
            padding: 0;
            margin-top: 2rem;
            box-shadow: none;
            border-radius: 0;
        }
    }
    .list-group-item {
        border: none;
        padding: 1rem 1.25rem;
        background-color: transparent;
    }
    .list-group-item:last-child {
        border-bottom: none;
    }
    
    .list-icon {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        margin-right: 12px;
        color: #6c757d;
    }
    /* --- Setup Lockout Overlay --- */
    .map-lockout-overlay {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.85);
        z-index: 2000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: white;
        text-align: center;
        padding: 20px;
        backdrop-filter: blur(5px);
    }
    .setup-step { transition: all 0.3s ease; }
    .btn-gps-setup { padding: 12px 24px; font-size: 1.1rem; border-radius: 50px; }

    /* Mobile App-like styling */
    .nav-pills .nav-link {
        border-radius: 50rem;
        color: #6c757d;
        font-weight: 600;
        display: inline-flex;
        padding: 0.5rem 1rem;
        margin-right: 0.5rem;
        justify-content: center;
        align-items: center;    
    }
    .nav-pills .nav-link.active {
        background-color: #df2020;
        color: white;
    }
    .profile-upload-wrapper {
        position: relative;
        display: inline-block;
        cursor: pointer;
    }
    .profile-upload-overlay {
        position: absolute;
        bottom: 0;
        right: 0;
        background-color: #df2020;
        color: white;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 3px solid white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        transition: transform 0.2s;
    }
    .profile-upload-wrapper:hover .profile-upload-overlay {
        transform: scale(1.1);
    }
    /* Hide scrollbar for tabs on mobile but allow scrolling */
    .mobile-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Container adjustments for iframe viewing */
    .roster-container {
        padding: 1rem;
        max-width: 600px;
        margin: 0 auto;
    }

    /* Modern Shift Cards */
    .shift-card {

        border-radius: 1.25rem;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        padding: 1rem;
        transition: transform 0.2s, box-shadow 0.2s;
        position: relative;
        overflow: hidden;
    }

    /* Calendar Block (Left Side) */
    .date-block {
        border-radius: 1rem;
        min-width: 65px;
        text-align: center;
        padding: 0.5rem;

    }
    
    .date-month { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
    .date-day { font-size: 1.5rem; font-weight: 800; line-height: 1; margin: 0.2rem 0; color: #212529; }
    .date-year { font-size: 0.7rem; font-weight: 600; }

    /* Active Shift Styling */
    .shift-card.is-active {
        border: 2px solid #df2020;
        box-shadow: 0 8px 24px rgba(223, 32, 32, 0.15);
    }
    .shift-card.is-active .date-block {
        background-color: #df2020;
        border-color: #df2020;
    }
    .shift-card.is-active .date-day, 
    .shift-card.is-active .date-year { color: white; }

    /* Completed Shift Styling */
    .shift-card.is-completed {
        opacity: 0.6;
    }

    /* Pulsing Red Dot for Active Status */
    .status-dot {
        height: 10px; width: 10px;
        background-color: #df2020;
        border-radius: 50%;
        display: inline-block;
        margin-right: 6px;
    }
    .pulse {
        animation: pulse-animation 2s infinite;
    }
    @keyframes pulse-animation {
        0% { box-shadow: 0 0 0 0 rgba(223, 32, 32, 0.5); }
        70% { box-shadow: 0 0 0 10px rgba(223, 32, 32, 0); }
        100% { box-shadow: 0 0 0 0 rgba(223, 32, 32, 0); }
    }

    /* Badge overrides */
    .time-badge {
        font-family: 'Inter', monospace;
        font-size: 0.8rem;
        font-weight: 600;
        color: #495057;
        padding: 0.35rem 0.6rem;
        border-radius: 0.5rem;
    }