@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap');

:root {
    --navy: #0c2d4a;
    --navy-mid: #1a4a6e;
    --navy-dark: #071a2c;
    --accent: #0ea5e9;
    --accent-soft: #e0f2fe;
    --surface: #ffffff;
    --surface-muted: #f0f4f8;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --status-normal: #059669;
    --status-warning: #d97706;
    --status-critical: #dc2626;
    --status-raining: #0284c7;
    --status-dry: #64748b;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(12, 45, 74, 0.08);
    --shadow: 0 4px 20px rgba(12, 45, 74, 0.1);
    --shadow-lg: 0 12px 40px rgba(12, 45, 74, 0.14);
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.bg-navy { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%) !important; }
.text-navy { color: var(--navy); }

/* —— Public page —— */
.public-page { background: var(--surface-muted); min-height: 100vh; display: flex; flex-direction: column; }
.public-hero {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 55%, #0e7490 100%);
    color: #fff;
    padding: 2rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}
.public-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}
.public-hero .container { position: relative; z-index: 1; }
.public-logo {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(255,255,255,0.25);
}
.public-hero h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.public-hero .tagline { opacity: 0.88; font-size: 0.95rem; max-width: 480px; margin: 0 auto; }

.public-banner {
    min-height: 200px;
    transition: background 0.5s ease, color 0.3s;
    position: relative;
}
.public-banner.status-normal {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
}
.public-banner.status-warning {
    background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
    color: #1c1917;
}
.public-banner.status-critical {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    color: #fff;
    animation: pulse-critical 2s ease-in-out infinite;
}
.public-banner.status-offline {
    background: #e8edf2;
    color: #64748b;
}
@keyframes pulse-critical {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(0,0,0,0); }
    50% { box-shadow: inset 0 0 80px rgba(0,0,0,0.15); }
}
.public-banner-inner { padding: 2rem 1rem; }
.public-banner .status-label {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}
.public-banner #statusText {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
}

.public-main { flex: 1; padding: 2.5rem 0 3rem; }
.metric-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card.metric-card-uniform {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
}
.metric-card.metric-card-uniform .metric-value,
.metric-card.metric-card-uniform .metric-value-sm {
    margin-bottom: 0;
}
.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.metric-card .metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.metric-card.water .metric-icon { background: var(--accent-soft); color: var(--navy); }
.metric-card.water.status-normal { border-color: var(--status-normal); }
.metric-card.water.status-warning { border-color: var(--status-warning); }
.metric-card.water.status-critical { border-color: var(--status-critical); }
.metric-card.water.status-offline { border-color: #e2e8f0; }
.metric-card.status-offline {
    border-color: #e2e8f0;
    box-shadow: none;
}
.metric-card.status-offline .metric-icon {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
}
.metric-card.status-offline .metric-value {
    color: #94a3b8;
}
.badge-offline {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
}
.metric-card .metric-status {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.metric-card.temp .metric-icon { background: #fef3c7; color: #b45309; }
.metric-card.humidity .metric-icon { background: #dbeafe; color: #1d4ed8; }
.metric-card.rain .metric-icon { background: #e0f2fe; color: var(--status-raining); }
.metric-card.time .metric-icon { background: #f1f5f9; color: var(--text-muted); }
.metric-card .metric-value.metric-value-sm { font-size: 1.1rem; }
.metric-card h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}
.public-cta {
    margin-top: 2rem;
    text-align: center;
}
.public-cta .btn-primary-custom {
    background: var(--navy);
    border: none;
    padding: 0.65rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, transform 0.2s;
}
.public-cta .btn-primary-custom:hover {
    background: var(--navy-mid);
    color: #fff;
    transform: translateY(-1px);
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
}
.live-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--status-normal);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* —— Footer —— */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.85);
    padding: 2.5rem 0 0;
    margin-top: auto;
}
.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.footer-brand i {
    font-size: 1.75rem;
    color: var(--accent);
    margin-top: 0.15rem;
}
.footer-brand strong { display: block; color: #fff; font-size: 1rem; }
.footer-brand span { font-size: 0.8rem; opacity: 0.75; }
.footer-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
}
.footer-contact li,
.footer-links li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.footer-contact i { width: 1.25rem; margin-right: 0.5rem; opacity: 0.7; }
.footer-contact a,
.footer-links a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
}
.footer-contact a:hover,
.footer-links a:hover { color: var(--accent); }
.footer-placeholder em { opacity: 0.7; font-style: normal; }
.footer-meta { font-size: 0.85rem; opacity: 0.8; }
.footer-bottom {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* —— App layout —— */
.app-body {
    background: var(--surface-muted);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-wrapper { display: flex; flex: 1; min-height: calc(100vh - 60px); }
.top-navbar {
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top-navbar .navbar-brand {
    font-weight: 600;
    font-size: 1rem;
}
.top-navbar .nav-contact {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    display: none;
}
@media (min-width: 992px) {
    .top-navbar .nav-contact { display: inline-flex; align-items: center; gap: 0.35rem; }
}
.top-navbar .nav-contact:hover { color: #fff; }

.sidebar {
    width: 268px;
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-nav { flex: 1; padding: 0.5rem 0; }
.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.72);
    padding: 0.7rem 1.25rem;
    margin: 0.15rem 0.75rem;
    border-radius: 8px;
    border-left: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar-nav .nav-link i { width: 1.35rem; text-align: center; opacity: 0.85; }
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(14, 165, 233, 0.25);
    box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}
.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.sidebar-brand small { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.6; }
.sidebar-brand .brand-name { font-size: 0.95rem; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-contact {
    padding: 1rem 1.25rem;
    margin: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
}
.sidebar-contact strong { display: block; color: #fff; font-size: 0.95rem; margin-top: 0.25rem; }
.sidebar-contact a { color: var(--accent-soft); text-decoration: none; }
.sidebar-offcanvas {
    width: 268px !important;
}
.sidebar-offcanvas .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    margin: 0.1rem 0.5rem;
}
.sidebar-offcanvas .nav-link.active {
    background: rgba(14, 165, 233, 0.2);
    color: #fff;
}

.main-content {
    flex: 1;
    padding: 1.5rem 1.75rem 2rem;
    overflow-x: auto;
}

/* Page header */
.page-header-title {
    font-family: 'Source Serif 4', serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-header-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-soft);
    color: var(--navy);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.page-header-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.35rem; margin-left: 3.5rem; }
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item.active { color: var(--navy); font-weight: 500; }

/* Cards & stats */
.panel-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-card .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.5rem;
    font-weight: 600;
    color: var(--navy);
}
.panel-card .card-body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.profile-page .profile-meta {
    margin-top: 0.75rem;
    padding-top: 0.35rem;
}
.profile-page .panel-card + .panel-card,
.profile-page .col-lg-8 > .panel-card {
    margin-bottom: 1.25rem;
}
.profile-summary-card {
    padding: 0.5rem 0.25rem;
}
.profile-photo {
    width: 140px;
    height: 140px;
    margin: 0.25rem auto 0;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 55%, #0e7490 100%);
    color: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.profile-initials {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}
.profile-display-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.85rem 0 0.65rem;
    line-height: 1.3;
}
.profile-role-badge {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
}
.profile-email {
    color: var(--text-muted);
    font-size: 0.9rem;
    word-break: break-word;
}
.profile-last-login {
    color: #94a3b8;
    font-size: 0.82rem;
}
.profile-edit-card {
    overflow: hidden;
}
.profile-edit-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.95rem 1.35rem;
}
.profile-edit-header i {
    font-size: 0.9rem;
    opacity: 0.9;
}
.profile-edit-card .card-body {
    padding: 1.5rem 1.5rem 1.6rem;
}
.profile-edit-card .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.profile-edit-card .form-control {
    border-radius: 10px;
    border-color: var(--border);
    padding: 0.55rem 0.8rem;
}
.profile-edit-card .form-control:disabled {
    background: #f8fafc;
    color: var(--text-muted);
}
.profile-save-btn {
    border-radius: 10px;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
}

.sdn-embed-wrap {
    background: #0f172a;
    min-height: 75vh;
    height: min(85vh, 1100px);
}
.sdn-embed-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 75vh;
    border: 0;
    background: #0f172a;
}

.stat-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card.stat-card-uniform {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 158px;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
}
.stat-card.status-normal::after { background: var(--status-normal); }
.stat-card.status-warning::after { background: var(--status-warning); }
.stat-card.status-critical::after { background: var(--status-critical); }
.stat-card.status-offline::after { background: transparent; }
.stat-card.status-offline {
    border-color: #e2e8f0;
    box-shadow: none;
}
.stat-card.status-offline .stat-value { color: #94a3b8; }
.stat-card .stat-status {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.stat-card .stat-value { font-size: 1.85rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat-card .stat-icon-wrap {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    opacity: 0.12;
    color: var(--navy);
}

.flood-status-card {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius-lg);
    color: #fff;
    box-shadow: var(--shadow);
    letter-spacing: 0.02em;
}
.flood-status-card.NORMAL { background: linear-gradient(135deg, #059669, #34d399); }
.flood-status-card.WARNING { background: linear-gradient(135deg, #d97706, #fbbf24); color: #1c1917; }
.flood-status-card.CRITICAL { background: linear-gradient(135deg, #b91c1c, #f87171); }
.flood-status-card.status-offline {
    background: #f1f5f9;
    color: #64748b;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.rain-raining { color: var(--status-raining) !important; }
.rain-dry { color: var(--status-dry) !important; }

/* Tables */
.table {
    font-size: 0.9rem;
}
.table thead th {
    background: var(--surface-muted);
    color: var(--navy);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.table tbody td { padding: 0.85rem 1rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--accent-soft); }
.table-empty { text-align: center; padding: 3rem !important; color: var(--text-muted); }

.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--navy);
    border-color: var(--navy);
}
.btn-primary:hover {
    background: var(--navy-mid);
    border-color: var(--navy-mid);
}
.btn-outline-primary {
    color: var(--navy);
    border-color: var(--navy);
}
.btn-outline-primary:hover {
    background: var(--navy);
    border-color: var(--navy);
}

.badge { font-weight: 600; padding: 0.4em 0.65em; }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-lg);
}
.card-chart { position: relative; min-height: 320px; }

/* Login */
.login-page {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 40%, #0e7490 100%);
    position: relative;
}
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 0h40v40H0z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}
.login-wrap { position: relative; z-index: 1; padding: 2rem 0; }
.login-page .site-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.login-autofill-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.login-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.login-card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    padding: 2rem 1.5rem;
    text-align: center;
}
.login-card-header .login-logo {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
.login-card-header h4 { font-family: 'Source Serif 4', serif; font-weight: 700; margin: 0; }
.login-card .form-control {
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    border-color: var(--border);
}
.login-card .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}
.alert-row-warning { background-color: rgba(217, 119, 6, 0.06) !important; }
.alert-row-critical { background-color: rgba(220, 38, 38, 0.06) !important; }

.password-strength { background: var(--border); border-radius: 4px; overflow: hidden; }
.password-strength .bar { height: 4px; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.password-strength .track { height: 4px; }

.profile-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    font-size: 2rem;
    box-shadow: var(--shadow-sm);
}
.profile-meta dt { font-weight: 500; }

.password-hint.text-danger,
.password-confirm-hint.text-danger {
    font-weight: 500;
}

@keyframes form-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-10px); }
    30% { transform: translateX(10px); }
    45% { transform: translateX(-8px); }
    60% { transform: translateX(8px); }
    75% { transform: translateX(-4px); }
    90% { transform: translateX(4px); }
}
.form-shake {
    animation: form-shake 0.45s ease-in-out;
}

.password-toggle-group .password-toggle-btn {
    border-color: var(--border);
    color: var(--text-muted);
    min-width: 2.75rem;
}
.password-toggle-group .password-toggle-btn:hover {
    background: var(--surface-muted);
    color: var(--navy);
}
.password-toggle-group .form-control:focus + .password-toggle-btn {
    border-color: var(--accent);
}

.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--border); }

.crud-modal .modal-dialog { max-width: 480px; }
.crud-modal-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    border: none;
    padding: 1.1rem 1.25rem;
}
.crud-modal .modal-body {
    padding: 1.25rem 1.5rem;
    background: #fafbfc;
}
.crud-modal .modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.35rem;
}
.crud-modal .modal-body .form-control,
.crud-modal .modal-body .form-select {
    border-radius: 8px;
    border-color: var(--border);
}
.crud-modal-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.table-actions .btn { font-size: 0.78rem; padding: 0.25rem 0.5rem; }
.pagination .page-link {
    color: var(--navy);
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1px solid var(--border);
}
.pagination .page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
}

@media print {
    @page {
        margin: 1.5cm;
    }

    .sidebar, .top-navbar, .site-footer, .no-print, .btn, .breadcrumb, .contact-banner { display: none !important; }
    .main-content { padding: 0; margin: 0; width: 100%; }
    .app-wrapper { display: block; }

    body.print-report-active .sidebar,
    body.print-report-active .top-navbar,
    body.print-report-active .site-footer,
    body.print-report-active .no-print,
    body.print-report-active .modal,
    body.print-report-active #toast-container,
    body.print-report-active .main-content > *:not(#printReport) {
        display: none !important;
    }
    body.print-report-active .app-wrapper,
    body.print-report-active .main-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    body.print-report-active #printReport {
        display: block !important;
        margin: 0;
        padding: 0;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        overflow: visible !important;
    }
    body.print-report-active #printReport .card-header {
        padding: 0.35rem 0 0.75rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #ccc;
        background: transparent !important;
        overflow: visible !important;
    }
    body.print-report-active #printReport .card-header strong {
        display: block;
        line-height: 1.35;
        font-size: 16pt;
        color: #000 !important;
    }
    body.print-report-active #printReport .card-body {
        padding: 0;
        overflow: visible !important;
    }
    body.print-report-active #printReport pre {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
}

@media (max-width: 991.98px) {
    .main-content { padding: 1rem; }
    .page-header-subtitle { margin-left: 0; }
}

#loginLogsLive { display: none; }

.login-logs-updated {
    animation: loginLogsFlash 0.6s ease;
}

@keyframes loginLogsFlash {
    from { background-color: rgba(25, 135, 84, 0.12); }
    to { background-color: transparent; }
}
