/* ================================================================
   HURAYNOVA — DESIGN SYSTEM (TYPOGRAPHY & BADGES POLISH)
   ================================================================ */

/* Base Typography Scale */
html, body {
    font-family: var(--f-body, "Inter", sans-serif);
    font-size: 14px; /* Body text: 14px */
    background-color: var(--c-surface);
    color: var(--c-text);
}

/* Page Titles */
h1, .page-title, .h1 {
    font-family: var(--f-display, "Space Grotesk", sans-serif);
    font-size: 26px !important; /* Page titles: 24-28px */
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

h2, .h2 { font-size: 22px !important; }
h3, .h3 { font-size: 18px !important; }
h4, .h4 { font-size: 16px !important; }
h5, .h5 { font-size: 15px !important; }
h6, .h6 { font-size: 14px !important; }

/* Links */
a, .btn-link {
    color: var(--c-blue);
    text-decoration: none;
}

/* Buttons */
.btn {
    font-size: 13px !important; /* Button text: 13-14px */
    padding: 0.4rem 1rem !important;
    border-radius: var(--r-full);
    font-weight: 600;
    transition: all var(--t) var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--c-blue), var(--c-blue-dark));
    color: #ffffff !important; 
    border: none;
    box-shadow: 0 4px 15px var(--c-blue-glow);
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-1px); 
    box-shadow: 0 6px 20px rgba(47,107,255,.4); 
    filter: brightness(1.08);
}

/* Forms */
.form-control, .form-select {
    font-size: 13px !important;
    padding: 0.4rem 0.8rem;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background-color: var(--c-bg);
    color: var(--c-text);
}
.form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

/* Cards */
.card {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--c-border);
    font-size: 16px !important; /* Card titles: 15-16px */
    font-weight: 600;
    color: var(--c-blue-deep);
    padding: 1rem 1.25rem;
}

/* Sidebar */
.sidebar {
    background-color: var(--c-blue-deep);
    color: #fff;
    font-size: 13px; /* Sidebar: 13px */
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    border-radius: var(--r-sm);
    margin: 4px 8px;
    padding: 0.6rem 1rem;
    font-weight: 500;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

/* Premium Tables */
.table {
    width: 100%;
    margin-bottom: 1.5rem;
    font-size: 13px !important; /* Table text: 13px */
}
.table th {
    background-color: #f8fafc;
    color: var(--c-text-2);
    font-size: 12px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--c-border);
    border-top: 1px solid var(--c-border);
}
.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
}
.table tbody tr:hover td {
    background-color: var(--c-surface);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.75em !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: var(--r-full) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none !important;
}

/* Badge variants mapping */
.badge-open {
    background-color: var(--c-blue) !important;
    color: #ffffff !important;
}
.badge-resolved, .badge-completed {
    background-color: var(--c-green) !important;
    color: #ffffff !important;
}
.badge-pending, .badge-missed, .badge-inprogress {
    background-color: #f59e0b !important;
    color: #000000 !important;
}
.badge-escalated, .badge-cancelled {
    background-color: var(--c-danger) !important;
    color: #ffffff !important;
}
.badge-closed, .badge-neutral {
    background-color: #64748b !important;
    color: #ffffff !important;
}

/* AI Copilot Features */
.ai-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 13px;
}
.ai-card-title {
    font-family: var(--f-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--c-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-badge { 
    padding: 0.25em 0.6em; 
    border-radius: var(--r-full); 
    font-size: 11px; 
    font-weight: 600; 
}
.ai-badge-low { background-color: #dcffe4; color: #1a7f37; }
.ai-badge-medium { background-color: #fff8c5; color: #9a6700; }
.ai-badge-high { background-color: #ffebe9; color: #cf222e; }

/* Incident Specifics */
.page-header-row {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}
.incident-photo {
    width: 100%; max-height: 420px; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--c-border); background: var(--c-surface);
}
.incident-photo--compact { max-height: 220px; }
.empty-state-panel {
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--c-border);
    border-radius: var(--r-lg);
    color: var(--c-text-2);
    background: #f8fafc;
    text-align: center;
}
.detail-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; font-size: 13px;
}

/* Animation Overrides */
:root {
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t: 200ms;
}

/* AI Similar Incident Cards */
.ai-match-card {
    display: block;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--c-text);
    transition: all var(--t) var(--ease);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    cursor: pointer;
}
.ai-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: rgba(47,107,255,.28);
}
.ai-match-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}
.ai-match-accent-green { background-color: var(--c-green); }
.ai-match-accent-yellow { background-color: #f59e0b; }
.ai-match-accent-orange { background-color: var(--c-orange); }
.ai-match-accent-red { background-color: var(--c-danger); }

.ai-match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.ai-match-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--c-text);
    padding-right: 1rem;
}
.ai-match-date {
    font-size: 11px;
    color: var(--c-text-2);
    margin-top: 0.25rem;
}
.ai-match-desc {
    font-size: 12px;
    color: var(--c-text-2);
    line-height: 1.5;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ai-match-badge-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ai-match-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.ai-match-badge.green { background-color: #ecfdf5; color: #059669; }
.ai-match-badge.yellow { background-color: #fffbeb; color: #d97706; }
.ai-match-badge.orange { background-color: #fff7ed; color: #c2410c; }
.ai-match-badge.red { background-color: #fef2f2; color: #dc2626; }

.ai-match-progress-container {
    width: 50px;
    height: 6px;
    background-color: var(--c-border);
    border-radius: var(--r-full);
    overflow: hidden;
    flex-shrink: 0;
}
.ai-match-progress-bar {
    height: 100%;
    border-radius: var(--r-full);
}

.ai-match-empty {
    padding: 2.5rem 1.5rem;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--c-border);
    text-align: center;
    color: var(--c-text-2);
}
.ai-match-empty i {
    font-size: 2.5rem;
    color: var(--c-blue-soft);
    margin-bottom: 1rem;
    display: block;
}
.ai-match-empty h6 {
    color: var(--c-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.ai-match-empty p {
    font-size: 13px;
    margin: 0;
}

/* Premium Modal Dialogs */
.modal-backdrop.glass {
    backdrop-filter: blur(8px);
    background-color: rgba(15, 23, 42, 0.4);
    transition: opacity 250ms ease-in-out;
}
.modal-content.premium {
    border-radius: var(--r-xl);
    border: 1px solid var(--c-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    background: var(--c-surface);
    overflow: hidden;
    transform: scale(0.98);
    opacity: 0;
    animation: modal-fade-in 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-content.premium .modal-header {
    background-color: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    padding: 1.25rem 1.5rem;
}
.modal-content.premium .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--c-text);
}
.modal-content.premium .modal-body {
    padding: 1.5rem;
    background-color: var(--c-surface);
}
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.modal.fade.show.premium-modal {
    display: block;
}

/* Clickable Rows & Cards */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}
.clickable-row:hover {
    background-color: var(--c-surface) !important;
}
.clickable-row:focus {
    outline: 2px solid var(--c-primary);
    outline-offset: -2px;
}
.selected-row {
    background-color: var(--c-surface) !important;
    position: relative;
}
.selected-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--c-primary);
}

.clickable-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.clickable-card:hover, .clickable-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}
.clickable-card:focus {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}
.selected-card {
    border-color: var(--c-primary) !important;
    border-width: 2px !important;
}
