/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Sofia Sans', system-ui, -apple-system, sans-serif;
}

/* ── App shell ──────────────────────────────────────────────── */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: 340px;
    flex-shrink: 0;
    min-width: 340px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 0 12px 12px;
}

.sidebar-logo {
    padding: 32px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-logo-img {
    width: 100%;
    max-width: 300px; 
    height: auto;
    display: block;
}

.sidebar-logo-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: #605e5c;
    line-height: 1.4;
    display: block;
}

.sidebar-logo-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f6cbd;
    line-height: 1.35;
    text-transform: uppercase;
    display: block;
}

/* ── Sidebar navigation ─────────────────────────────────────── */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item-wrapper {
    position: relative;
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 10px;
    border-radius: 4px;
    color: #242424;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    width: 100%;
    transition: background-color 0.1s;
}

    .nav-item-wrapper.is-active .nav-item,
    .nav-item.is-active {
        background-color: #ffffff;
    }

    .nav-item:hover {
        background-color: rgba(0, 0, 0, 0.04);
        color: #242424;
        text-decoration: none;
    }

.nav-item-wrapper.is-active .nav-item:hover {
    background-color: #ffffff;
}

/* Blue pill on the left of the active item */
.nav-active-bar {
    position: absolute;
    left: -3px;
    top: 0;
    width: 3px;
    height: 44px;
    pointer-events: none;
    z-index: 1;
}

    .nav-active-bar::before {
        content: '';
        position: absolute;
        top: 8px;
        bottom: 8px;
        left: 0;
        width: 3px;
        background-color: #0f6cbd;
        border-radius: 999px;
    }

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    flex-shrink: 0;
    color: #424242;
}

.nav-item-wrapper.is-active .nav-icon {
    color: #0f6cbd;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Main content area ──────────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0;
    background-color: #faf9f9;
    height: 100vh;
    overflow-y: auto;
    padding: 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.breadcrumb-link {
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
    color: #424242;
    text-decoration: none;
    padding: 8px;
    border-radius: 4px;
}

    .breadcrumb-link:hover {
        background-color: rgba(0, 0, 0, 0.04);
        color: #424242;
    }

.breadcrumb-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #616161;
    font-size: 10px;
}

.breadcrumb-current {
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
    color: #424242;
    padding: 8px;
}

/* ── Page-heading card ──────────────────────────────────────── */
.page-heading {
    background: #ffffff;
    border-radius: 4px;
    padding: 24px;
    flex-shrink: 0;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.14), 0 0 1px rgba(0, 0, 0, 0.12);
}

.page-heading-title {
    font-weight: 600;
    font-size: 24px;
    line-height: 32px;
    color: #1f1f1f;
    margin: 0 0 16px;
}

.page-heading-subtitle {
    font-weight: 400;
    font-size: 16px;
    line-height: 22px;
    color: #1f1f1f;
    margin: 0;
}

/* ── Table wrapper card ─────────────────────────────────────── */
.table-wrapper {
    background: #ffffff;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 4px;
}

.table-toolbar-title {
    font-weight: 600;
    font-size: 20px;
    line-height: 26px;
    color: #1f1f1f;
    margin: 0;
}

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

/* ── Fluent-style outline buttons ───────────────────────────── */
.btn-fluent {
    background-color: #ffffff;
    border: 1px solid #d1d1d1;
    color: #242424;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.5;
    padding: 6px 12px;
    border-radius: 4px;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

    .btn-fluent:hover {
        background-color: #f5f5f5;
        color: #242424;
        text-decoration: none;
    }

.btn-fluent-primary {
    background-color: #0f6cbd;
    border-color: #0f6cbd;
    color: #ffffff;
}

    .btn-fluent-primary:hover {
        background-color: #115ea3;
        border-color: #115ea3;
        color: #ffffff;
    }

/* ── Status badges ──────────────────────────────────────────── */
.badge-success-fluent {
    background-color: #f1faf1;
    border: 1px solid #9fd89f;
    color: #0e700e;
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    text-wrap: auto !important;
    padding: 0 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    white-space: nowrap;
}

.badge-warning-fluent {
    background-color: #FFF9F5;
    border: 1px solid #FDCFB4;
    color: #8A3707;
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    text-wrap: auto !important;
    padding: 0 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    white-space: nowrap;
}


.badge-danger-fluent {
    background-color: #fdf3f4;
    border: 1px solid #eeacb2;
    color: #b10e1c;
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    text-wrap: auto !important;
    padding: 0 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    white-space: nowrap;
}

/* ── DataTables overrides to match design ───────────────────── */
/*table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
}

table.dataTable thead th,
table.dataTable thead td {
  font-weight: 700 !important;
  font-size: 14px !important;
  line-height: 20px !important;
  color: #242424 !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(0, 17, 102, 0.1) !important;
  padding: 14px 24px !important;
  background-color: #ffffff !important;
}

table.dataTable tbody td {
  font-size: 16px;
  line-height: 22px;
  color: #242424;
  border-top: none !important;
  border-bottom: 1px solid rgba(0, 17, 102, 0.1) !important;
  padding: 0 24px !important;
  height: 80px;
  vertical-align: middle;
}

table.dataTable tbody tr:last-child td {
  border-bottom: none !important;
}

table.dataTable tbody tr:hover > td {
  background-color: rgba(0, 17, 102, 0.02) !important;
}*/

/* Remove default DataTables search/length bar spacing from wrapper */
/*div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_length {
  margin-bottom: 8px;
}

div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
  margin-top: 12px;
}*/

/* DataTables Buttons — make them look like .btn-fluent */
/*.dt-buttons .dt-button,
.dt-buttons .dt-button:hover,
.dt-buttons .dt-button:active,
.dt-buttons .dt-button:focus {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d1d1d1 !important;
  color: #242424 !important;
  font-family: 'Segoe UI', system-ui, sans-serif !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-radius: 4px !important;
  padding: 6px 12px !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.dt-buttons .dt-button:hover {
  background-color: #f5f5f5 !important;
}*/

/* ── Form focus ring (kept from original) ───────────────────── */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ── Login page ─────────────────────────────────────────────── */
/* NOTE: Replace the background-image URL with a local asset    */
/* (e.g. ~/images/login-bg.jpg) — Figma URLs expire in 7 days. */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('https://www.figma.com/api/mcp/asset/38fac719-daa9-4c79-8bb0-a6408330f570');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

    .login-page::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 50% 50%, rgba(0, 12, 54, 0.15) 0%, rgba(9, 20, 60, 1) 100%);
        pointer-events: none;
    }

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: #ffffff;
    border-radius: 4px;
    padding: 40px;
    width: 100%;
    max-width: 376px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.20), 0 32px 64px rgba(0, 0, 0, 0.24);
}

.login-title {
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
    color: #1f1f1f;
    margin: 0;
}

.btn-kep {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 12px;
    background-color: #3050c6;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

    .btn-kep:hover {
        background-color: #2440a8;
        color: #ffffff;
        text-decoration: none;
    }

.btn-kep-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Floating-label form helpers (kept from original) ───────── */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Drawer (Criteria panel) ─────────────────────────────────── */
.drawer-overlay {
    position: fixed;
    left: 340px; /* sidebar width */
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

    .drawer-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    z-index: 101;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.20), 0px 32px 64px rgba(0, 0, 0, 0.24);
}

    .drawer-panel.is-open {
        transform: translateX(0);
    }

.drawer-header {
    background: #ffffff;
    padding: 24px 16px 0 24px;
    flex-shrink: 0;
}

.drawer-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 12px;
}

.drawer-title {
    flex: 1;
    font-family: 'Sofia Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    color: #242424;
    margin: 0;
}

.drawer-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #242424;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.15s;
}

    .drawer-close-btn:hover {
        background: rgba(0, 0, 0, 0.06);
    }

.drawer-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 -16px 0 -24px;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 0 24px;
    background: #ffffff;
}

.drawer-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.drawer-status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    border: 2px solid #ffffff;
}

    .drawer-status-dot.success {
        color: #107C10;
    }

    .drawer-status-dot.danger {
        color: #B10E1C;
    }

.drawer-section-title {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    color: #242424;
}

.drawer-criteria-list {
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .drawer-criteria-list li {
        font-family: 'Sofia Sans', sans-serif;
        font-size: 12px;
        font-weight: 600;
        line-height: 16px;
        color: #424242;
    }

.drawer-footer {
    background: #ffffff;
    padding: 16px 24px 24px 24px;
    flex-shrink: 0;
}

    .drawer-footer .btn-fluent-primary {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 16px;
        font-weight: 600;
        padding: 8px 12px;
    }



.reportCount {
    background-color: #f1faf1;
    border: 1px solid #107c10;
    color: #107c10;
    font-weight: 600;
    font-size: 14px;
    line-height: 16px;
    padding: 0 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    white-space: nowrap;
}

.offcanvas-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/*Media queries за мобилна версия*/
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .canvas-mobile{
        width: 90% !important;
    }

    .sidebar {
        width: 100%;
        height: auto;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-logo {
        flex: 1;
        padding: 12px 4px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }

    .main-content {
        padding: 8px 24px;
    }
}
