/* ===== Base Styles Section Start ===== */
body {
    background-color: rgb(28, 44, 109) !important;
    color: white !important;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

/* Subtle visual polish for the whole app */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(500px 240px at 10% -10%, rgba(76, 145, 255, 0.20), transparent 70%),
        radial-gradient(420px 220px at 100% 0%, rgba(94, 227, 167, 0.14), transparent 70%);
}

button,
.btn,
input[type="submit"] {
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.2s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
}

button:active,
.btn:active,
input[type="submit"]:active {
    transform: translateY(0);
}

a,
button,
input,
select,
textarea {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 2px rgba(74, 146, 255, 0.95), 0 0 0 5px rgba(74, 146, 255, 0.25);
    border-color: #4a92ff !important;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: #0c1430;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #2f4c90, #1f325f);
    border: 2px solid #0c1430;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3d62b5, #26407d);
}

.card {
    background-color: #31426df0 !important;
    border:2px solid #8c91cd !important;
    border-radius: 2px;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    -ms-border-radius: 2px;
    -o-border-radius: 2px;
}

.error{
    background-color: rgb(236, 78, 78);
    color:#fff;
    text-align: center;
    padding: 10px;
    transition: all .5s linear;
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    -ms-transition: all .5s linear;
    -o-transition: all .5s linear;
}
/* ===== Base Styles Section End ===== */

/* ===== Login Page Section Start ===== */
.login-body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, #0f1f49 0%, #090f23 45%, #060b1d 100%) !important;
}

.login-wrapper {
    width: min(92%, 540px);
}

.login-card {
    background: #101a38;
    border: 1px solid #243560;
    border-radius: 22px;
    padding: 30px 28px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
}

.login-logo {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    margin: 0 auto 14px;
    box-shadow: 0 0 24px rgba(76, 145, 255, 0.35);
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 2rem;
}

.login-subtitle {
    margin: 6px 0 20px;
    text-align: center;
    color: #8ea0d4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.83rem;
}

.role-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.role-card {
    width: 100%;
    border: 1px solid #253766;
    border-radius: 12px;
    padding: 10px 8px;
    background: #18254b;
    text-align: left;
    cursor: pointer;
}

.role-card span {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
}

.role-card small {
    color: #95a9de;
    font-size: 0.76rem;
}

.role-admin span { color: #ff7ea7; }
.role-operator span { color: #ffbb4a; }
.role-citizen span { color: #5ee3a7; }

.role-card.active {
    border-color: #4a92ff;
    box-shadow: 0 0 0 1px #4a92ff inset;
    transform: translateY(-1px);
}

.login-result {
    min-height: 24px;
    margin: 0 0 8px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.login-card label {
    display: block;
    color: #96a9dd;
    font-size: 0.8rem;
    margin: 11px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"],
.login-card input#mail,
.login-card input#pass {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #253766;
    border-radius: 12px;
    background: #18254b;
    color: #e6ecff;
    padding: 14px 14px;
    font-size: 1rem;
    outline: none;
}

.login-card input::placeholder {
    color: #7f93cb;
}

.login-submit {
    width: 100%;
    margin-top: 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, #3f82ee, #4a92ff);
    color: white;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.login-submit:hover {
    filter: brightness(1.08);
}
/* ===== Login Page Section End ===== */

/* ===== Dashboard Layout Section Start ===== */
.dashboard-body {
    margin: 0;
    background: #090f23 !important;
    color: #e6ecff !important;
}

.dashboard-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    transition: grid-template-columns 0.25s ease;
    position: relative;
}

.sidebar {
    background: #0d1734;
    border-right: 1px solid #1e2d5c;
    padding: 22px 14px;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.22);
}

.dashboard-body.sidebar-hidden .dashboard-layout {
    grid-template-columns: 0 1fr;
}

.dashboard-body.sidebar-hidden .sidebar {
    opacity: 0;
    transform: translateX(-16px);
    pointer-events: none;
    border-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-edge-toggle {
    position: absolute;
    left: 250px;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    width: 32px;
    height: 64px;
    border-radius: 999px;
    border: 1px solid #2d417c;
    background: #121d42;
    color: #e5edff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: left 0.25s ease, transform 0.2s ease;
}

.sidebar-edge-toggle:hover {
    transform: translate(-50%, -50%) scale(1.03);
}

.dashboard-body.sidebar-hidden .sidebar-edge-toggle {
    left: 0;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.brand img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 12px;
}

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

.brand-sub {
    margin: 0;
    color: #9eb0df;
    font-size: 0.75rem;
}

.nav-group {
    margin-top: 18px;
}

.nav-title {
    color: #7f8fb8;
    font-size: 0.72rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #ccd7fa;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.94rem;
    margin-bottom: 4px;
    display: block;
    text-decoration: none;
}

.menu-item.active,
.menu-item:hover {
    background: #1a2a5b;
    color: #ffffff;
}

.sidebar-footer {
    position: sticky;
    top: calc(100vh - 120px);
    margin-top: 24px;
    color: #8ba0d7;
    font-size: 0.85rem;
}

.main-content {
    padding: 18px 18px 24px;
}
/* ===== Dashboard Layout Section End ===== */

/* ===== Topbar and Controls Section Start ===== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notification-wrap {
    position: relative;
}

.notification-btn {
    min-width: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notification-count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    background: #ff4f86;
    color: #ffffff;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(92vw, 360px);
    background: #0f1c41;
    border: 1px solid #2a427a;
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
    padding: 10px;
    z-index: 60;
    display: none;
}

.notification-dropdown.open {
    display: block;
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-head strong {
    font-size: 0.9rem;
}

.notification-clear-btn {
    padding: 5px 9px;
    font-size: 0.74rem;
}

.notification-list {
    display: grid;
    gap: 7px;
    max-height: 280px;
    overflow-y: auto;
}

.notification-item {
    border: 1px solid #233a70;
    border-radius: 10px;
    padding: 8px;
    background: #14244f;
}

.notification-item.unread {
    border-color: #4a92ff;
    background: #172b5f;
}

.notification-item p {
    margin: 0;
    font-size: 0.82rem;
    color: #dbe5ff;
}

.notification-item small {
    color: #9fb2e8;
    font-size: 0.72rem;
}

.topbar h2 {
    font-size: 1.18rem;
    margin: 0;
}

.live-meta {
    margin: 0 0 12px;
    color: #95a9de;
    font-size: 0.85rem;
}

.ops-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.ops-item {
    background: #0f1c41;
    border: 1px solid #243560;
    border-radius: 12px;
    padding: 10px 12px;
}

.ops-item p {
    margin: 0;
    color: #8ea0d4;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ops-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1rem;
}

.ops-item small {
    color: #8ea0d4;
    font-size: 0.75rem;
}

.refresh-btn {
    border: 1px solid #2d417c;
    background: #121d42;
    color: #e5edff;
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(6, 12, 30, 0.35);
}

.refresh-btn:hover {
    background: #1a2a5b;
    color: #ffffff;
}

.signout-btn {
    background: #2a1835;
    border-color: #603678;
}
/* ===== Topbar and Controls Section End ===== */

/* ===== Metrics and Panels Section Start ===== */
.cards-grid {
    margin-bottom: 12px;
}

.metric-card,
.panel {
    background: #101a38;
    border: 1px solid #243560;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.metric-card {
    padding: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: #3a61ae;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.metric-title {
    color: #8ea0d4;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}

.metric-sub {
    color: #7f92c9;
    font-size: 0.8rem;
}

.badge-state {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.state-warning { background: rgba(255, 165, 0, 0.15); color: #ffbb4a; }
.state-normal { background: rgba(54, 179, 126, 0.15); color: #5ee3a7; }
.state-critical { background: rgba(255, 73, 122, 0.15); color: #ff7ea7; }

.panel-grid {
    margin: 0;
}

.panel {
    padding: 12px;
    min-height: 280px;
}

.panel h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-tag {
    font-size: 0.68rem;
    color: #8ea0d4;
    border: 1px solid #35559e;
    border-radius: 999px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chart-wrap {
    height: 220px;
}

.dashboard-refreshing .panel,
.dashboard-refreshing .metric-card {
    animation: refreshPulse 0.45s ease;
}

@keyframes refreshPulse {
    0% { opacity: 0.72; transform: scale(0.995); }
    100% { opacity: 1; transform: scale(1); }
}

.donut-panel {
    display: flex;
    flex-direction: column;
}

.status-list {
    margin-top: auto;
    font-size: 0.86rem;
    color: #a8b7e2;
}

.status-list div {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.complaints-routing,
.complaints-live-feed {
    margin-top: 12px;
    border-top: 1px solid #243560;
    padding-top: 10px;
}

.complaints-routing h4,
.complaints-live-feed h4 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #a8b7e2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.routing-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #1d2b53;
    font-size: 0.8rem;
}

.routing-category {
    color: #dbe5ff;
    font-weight: 600;
}

.routing-owner {
    color: #9fb2e8;
}

.routing-sla {
    color: #5ee3a7;
    font-weight: 600;
}

.complaints-table-wrap {
    overflow-x: auto;
}

.complaints-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.complaints-table th,
.complaints-table td {
    padding: 6px 5px;
    border-bottom: 1px solid #1d2b53;
    text-align: left;
    white-space: nowrap;
}

.complaints-table th {
    color: #9fb2e8;
    font-weight: 600;
}

.complaints-table td {
    color: #dbe5ff;
}

.complaint-status-select {
    border: 1px solid #35559e;
    background: #14244f;
    color: #e6ecff;
    border-radius: 8px;
    padding: 4px 6px;
    font-size: 0.76rem;
}

.complaint-status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.complaint-status-new {
    color: #ffbe63;
    background: rgba(255, 182, 72, 0.2);
}

.complaint-status-in-progress {
    color: #88d6ff;
    background: rgba(86, 166, 255, 0.22);
}

.complaint-status-resolved {
    color: #69e8ba;
    background: rgba(86, 217, 170, 0.22);
}

.complaints-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.complaints-kpi-row div {
    border: 1px solid #243560;
    background: #0f1c41;
    border-radius: 10px;
    padding: 8px;
}

.complaints-kpi-row span {
    display: block;
    font-size: 0.7rem;
    color: #9fb2e8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.complaints-kpi-row strong {
    display: block;
    margin-top: 4px;
    font-size: 1rem;
}

.complaints-toggle-btn {
    margin-top: 10px;
    border: 1px solid #35559e;
    background: #14244f;
    color: #e6ecff;
    width: 100%;
}

.complaints-toggle-btn:hover {
    background: #1a2f66;
    color: #ffffff;
}

.complaints-details {
    margin-top: 10px;
}

.complaints-details.collapsed {
    display: none;
}

.incident-table-wrap {
    overflow-x: auto;
}

.incident-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.incident-table th,
.incident-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #1d2b53;
    text-align: left;
    white-space: nowrap;
}

.incident-table th {
    color: #9fb2e8;
}

.severity {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.severity-critical {
    color: #ff9db8;
    background: rgba(255, 79, 134, 0.22);
}

.severity-high {
    color: #ffcc86;
    background: rgba(255, 182, 72, 0.22);
}

.severity-medium {
    color: #88d6ff;
    background: rgba(86, 166, 255, 0.22);
}

.mini-action-btn {
    border: 1px solid #35559e;
    background: #152752;
    color: #dbe5ff;
    border-radius: 8px;
    font-size: 0.72rem;
    padding: 4px 7px;
}

.audit-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #1d2b53;
}

.audit-time {
    font-weight: 700;
    color: #8ea0d4;
    min-width: 42px;
}

.audit-content p {
    margin: 0;
    font-size: 0.82rem;
}

.audit-content small {
    color: #9fb2e8;
    font-size: 0.75rem;
}

.audit-status {
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    height: fit-content;
}

.audit-done {
    color: #7af0c2;
    background: rgba(86, 217, 170, 0.2);
}

.audit-warn {
    color: #ffcc86;
    background: rgba(255, 182, 72, 0.22);
}
/* ===== Metrics and Panels Section End ===== */

.citizen-complaint-form label {
    display: block;
    color: #9fb2e8;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.citizen-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.citizen-complaint-form input,
.citizen-complaint-form select,
.citizen-complaint-form textarea {
    width: 100%;
    border: 1px solid #243560;
    border-radius: 10px;
    background: #14244f;
    color: #e6ecff;
    padding: 10px;
}

.citizen-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.citizen-form-actions small {
    color: #8fdab2;
    font-size: 0.82rem;
}

/* ===== Alerts Components Section Start ===== */
.alerts-list {
    display: grid;
    gap: 12px;
}

.alert-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #101a38;
    border: 1px solid #243560;
    border-left: 4px solid #243560;
    border-radius: 12px;
    padding: 14px;
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.alert-main h3 {
    margin: 6px 0 2px;
    font-size: 1.02rem;
}

.alert-main p {
    margin: 0;
    color: #92a7dd;
    font-size: 0.86rem;
}

.alert-main small {
    display: inline-block;
    margin-top: 6px;
    color: #b6c5ed;
    font-size: 0.82rem;
}

.alert-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.alert-value {
    text-align: right;
    min-width: 120px;
}

.alert-value strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-top: 4px;
}

.alert-value span {
    color: #95a8dd;
    font-size: 0.8rem;
}

.alert-critical {
    border-left-color: #ff4f86;
}

.alert-critical .alert-badge {
    background: rgba(255, 79, 134, 0.2);
    color: #ff89ad;
}

.alert-critical .alert-value strong {
    color: #ff89ad;
}

.alert-warning {
    border-left-color: #ffb648;
}

.alert-warning .alert-badge {
    background: rgba(255, 182, 72, 0.22);
    color: #ffbe63;
}

.alert-warning .alert-value strong {
    color: #ffbe63;
}

.alert-normal {
    border-left-color: #56d9aa;
}

.alert-normal .alert-badge {
    background: rgba(86, 217, 170, 0.2);
    color: #69e8ba;
}

.alert-normal .alert-value strong {
    color: #69e8ba;
}
/* ===== Alerts Components Section End ===== */

/* ===== Responsive Rules Section Start ===== */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .sidebar-edge-toggle {
        display: none;
    }
    .ops-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .citizen-form-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== Responsive Rules Section End ===== */