@import url("https://fonts.cdnfonts.com/css/janna-lt");

:root {
    --saqr-navy: #1f4f8f;
    --saqr-navy-2: #17467f;
    --saqr-blue: #159bd7;
    --saqr-teal: #35c9c5;
    --saqr-cyan: #23bfd0;
    --saqr-orange: #f47b20;
    --saqr-red: #dc2626;
    --saqr-gray: #7c8da8;
    --saqr-bg: #f3f6fd;
    --saqr-border: #dfe8f4;
    --saqr-text: #1e3561;
    --saqr-muted: #72829f;
    --saqr-soft-blue: #eaf7ff;
    --saqr-soft-teal: #e7fbfa;
}

* {
    letter-spacing: 0;
}

body {
    background: var(--saqr-bg);
    color: var(--saqr-text);
    font-family: "Janna LT", "Janna", "Janna LT Regular", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fd 100%);
}

.auth-panel {
    background: linear-gradient(135deg, #ffffff 0%, #e9f7ff 48%, #e9fbfa 100%);
    color: var(--saqr-navy);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 42px;
    border-left: 4px solid var(--saqr-teal);
}

.auth-card {
    align-self: center;
    width: min(440px, calc(100% - 32px));
    background: #fff;
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(31, 79, 143, 0.12);
    padding: 32px;
}

.auth-panel .text-info {
    color: var(--saqr-blue) !important;
}

.auth-panel .text-white-50 {
    color: rgba(30, 53, 97, 0.7) !important;
}

.auth-main {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px;
}

.auth-credit,
.app-footer {
    color: var(--saqr-muted);
    font-size: 0.86rem;
    text-align: center;
}

.auth-hero-identity {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--saqr-teal), #0ea5e9);
    color: #fff;
    font-weight: 800;
}

.auth-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(31, 79, 143, 0.12);
    box-shadow: 0 12px 28px rgba(31, 79, 143, 0.12);
    padding: 6px;
}

.auth-hero-identity .auth-logo-large {
    width: 190px;
    height: 190px;
    margin-bottom: 18px;
    border-radius: 22px;
    padding: 12px;
}

.auth-hero-identity .brand-mark.auth-logo-large {
    font-size: 4.5rem;
}

.auth-hero-subtitle {
    color: var(--saqr-blue);
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: -8px;
}

.app-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(31, 79, 143, 0.12);
    box-shadow: 0 10px 24px rgba(31, 79, 143, 0.1);
    padding: 5px;
    flex: 0 0 auto;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.side-nav {
    background: #ffffff;
    color: var(--saqr-navy);
    padding: 22px 18px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    border-left: 1px solid var(--saqr-border);
    box-shadow: -8px 0 24px rgba(31, 79, 143, 0.05);
}

.side-nav .nav-link {
    color: var(--saqr-navy);
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.side-nav .nav-link.active,
.side-nav .nav-link:hover {
    background: linear-gradient(90deg, var(--saqr-soft-teal), var(--saqr-soft-blue));
    color: var(--saqr-navy);
    box-shadow: inset -4px 0 0 var(--saqr-teal);
}

.side-nav .nav-section {
    font-size: 0.72rem;
    color: var(--saqr-muted);
    margin: 24px 12px 8px;
}

.main-area {
    min-width: 0;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.topbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--saqr-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.page-wrap {
    padding: 24px;
    flex: 1;
}

.app-footer {
    padding: 12px 24px 18px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
}

.muted {
    color: var(--saqr-muted);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 12px;
}

.kpi-card,
.panel,
.table-panel,
.incident-header,
.timeline-card {
    background: #fff;
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(31, 79, 143, 0.07);
}

.kpi-card {
    padding: 16px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom: 4px solid var(--saqr-teal);
}

.kpi-card .icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--saqr-soft-teal);
    color: var(--saqr-teal);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
    color: var(--saqr-navy);
}

.panel {
    padding: 18px;
    border-top: 4px solid var(--saqr-teal);
}

.table-panel {
    overflow: hidden;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.85rem;
}

.badge-soft {
    border-radius: 999px;
    padding: 0.42rem 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-positive { background: #dffaf8; color: #0f827e; }
.badge-neutral { background: #e7f5ff; color: #1f4f8f; }
.badge-negative { background: #fee2e2; color: #b91c1c; }
.badge-low { background: #dffaf8; color: #0f827e; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-urgent { background: #ffedd5; color: #c2410c; }
.badge-critical { background: #fee2e2; color: #b91c1c; }
.badge-closed { background: #edf3fa; color: #52637d; }

.sla-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 0.42rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.sla-green { background: #dffaf8; color: #0f827e; }
.sla-yellow { background: #fef3c7; color: #92400e; }
.sla-red { background: #fee2e2; color: #b91c1c; }
.sla-gray { background: #edf3fa; color: #52637d; }
.sla-blue { background: #e7f5ff; color: #1f4f8f; }

.feed-list {
    display: grid;
    gap: 10px;
}

.feed-item {
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.twitter-alert {
    border-right: 4px solid var(--saqr-blue);
}

.twitter-alert.watch {
    border-right-color: var(--saqr-teal);
}

.twitter-alert.important {
    border-right-color: var(--saqr-orange);
}

.twitter-alert.critical {
    border-right-color: var(--saqr-red);
    background: #fff8f8;
}

.matched-keyword {
    background: #fff3b0;
    color: var(--saqr-navy);
    border-radius: 6px;
    padding: 0 4px;
    font-weight: 900;
}

.query-code {
    display: block;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
    color: var(--saqr-navy);
    background: #f6fbff;
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    padding: 10px;
    line-height: 1.8;
}

.query-details summary {
    cursor: pointer;
    list-style: none;
}

.query-details summary::-webkit-details-marker {
    display: none;
}

.classification-form {
    min-width: 180px;
}

.operations-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
}

.operation-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    background: #fff;
    color: var(--saqr-navy);
    box-shadow: 0 12px 28px rgba(31, 79, 143, 0.06);
}

.operation-chip strong {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--saqr-soft-blue);
    color: var(--saqr-navy);
}

.operation-chip.active {
    border-color: var(--saqr-teal);
    background: var(--saqr-soft-teal);
}

.operation-chip.active strong {
    background: var(--saqr-teal);
    color: #fff;
}

.install-pwa-btn,
.notify-toggle-btn {
    display: none;
}

.install-pwa-btn.is-ready,
.notify-toggle-btn.is-ready {
    display: inline-flex;
}

.priority-strip {
    width: 4px;
    border-radius: 6px;
    background: var(--saqr-blue);
}

.priority-strip.critical { background: var(--saqr-red); }
.priority-strip.urgent { background: var(--saqr-orange); }
.priority-strip.medium { background: var(--saqr-orange); }
.priority-strip.low { background: var(--saqr-teal); }

.incident-header {
    padding: 20px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
}

.meta-item {
    border: 1px solid var(--saqr-border);
    border-radius: 8px;
    padding: 12px;
    background: #fbfdff;
}

.timeline {
    position: relative;
    display: grid;
    gap: 12px;
}

.timeline-card {
    padding: 14px;
    border-right: 4px solid var(--saqr-blue);
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: #d6e2ef;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--saqr-teal);
    box-shadow: 0 0 0 0.2rem rgba(53, 201, 197, 0.18);
}

.btn {
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
}

.btn-primary {
    background: var(--saqr-blue);
    border-color: var(--saqr-blue);
}

.btn-primary:hover {
    background: #0f87c4;
    border-color: #0f87c4;
}

.btn-teal {
    background: var(--saqr-teal);
    border-color: var(--saqr-teal);
    color: #fff;
}

.btn-teal:hover {
    background: #22b7b3;
    border-color: #22b7b3;
    color: #fff;
}

.mobile-nav {
    display: none;
}

.chart-box {
    min-height: 300px;
}

.executive-ribbon {
    background: linear-gradient(135deg, #ffffff, #e7f5ff 45%, #e7fbfa);
    color: var(--saqr-navy);
    border-radius: 8px;
    padding: 18px;
    border: 1px solid var(--saqr-border);
    border-bottom: 4px solid var(--saqr-teal);
}

.executive-ribbon .text-white-50 {
    color: var(--saqr-muted) !important;
}

@media (max-width: 1180px) {
    .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        min-height: 230px;
        padding: 28px;
        gap: 24px;
    }

    .auth-hero-identity .auth-logo-large {
        width: 132px;
        height: 132px;
        margin-bottom: 8px;
    }

    .app-shell {
        display: block;
    }

    .side-nav {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .page-wrap {
        padding: 16px;
    }

    .kpi-grid,
    .operations-strip,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .table-responsive {
        border: 0;
    }
}
