/*
 * Modern look for the panel, the organization pages and both login pages.
 * Loaded after the old theme; it only restyles, the page markup stays the same.
 */

:root {
    --brand: #1d5fb0;
    --brand-dark: #154a8c;
    --brand-soft: #e8f0fb;
    --accent: #c4183c;
    --bg: #f3f5f9;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #1f2a37;
    --muted: #6b7686;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --font: "Segoe UI", "Noto Sans Armenian", "Noto Sans", Arial, sans-serif;
    --sidebar: #102a4c;
    --sidebar-2: #0b1f3a;
    --pending: #e0b800;
    --pending-bg: #fff59d;
    --accepted: #17a34a;
    --accepted-bg: #c4efd1;
    --declined: #e5484d;
    --declined-bg: #ffcdd0;
}

/* ---------- Base ---------- */

html, body {
    font-family: var(--font) !important;
    color: var(--text);
    background: var(--bg) !important;
    -webkit-font-smoothing: antialiased;
}
body, .content-wrap, .content { background: var(--bg); }
a { color: var(--brand); }
a:hover, a:focus { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6, .page-title { font-family: var(--font) !important; color: var(--text); }

.page-title {
    font-size: 26px !important;
    font-weight: 600 !important;
    margin: 6px 0 22px !important;
    letter-spacing: -.01em;
}
.page-title small, .page-title small small { color: var(--muted) !important; font-size: 14px !important; font-weight: 400; }

/* ---------- Cards ---------- */

.widget, .tab-content, .tab-pane-inner {
    background: var(--surface);
    border-radius: var(--radius);
}
.widget {
    border: 1px solid var(--border);
    box-shadow: var(--shadow) !important;
    padding: 20px 22px !important;
}
.widget > header h4, .widget > header h5 { font-weight: 600; color: var(--text); }
.widget > header hr { border-color: var(--border); }
.tab-content {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px !important;
    border-top-left-radius: 0;
}

/* ---------- Tabs ---------- */

.nav-tabs { border-bottom: none !important; }
.nav-tabs > li > a {
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: var(--surface) !important;
    color: var(--brand) !important;
    font-weight: 600;
    padding: 11px 20px !important;
    margin-right: 4px;
}

/* ---------- Forms ---------- */

.form-control, .dataTables_filter input, .dataTables_length select, input[type=text], input[type=email], input[type=password] {
    border: 1px solid #d5dce6 !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    min-height: 38px;
    color: var(--text);
    background-color: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .dataTables_filter input:focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(29, 95, 176, .15) !important;
    outline: none;
}
label, .control-label, .form-group h6 { color: var(--muted); font-weight: 600; font-size: 13px; }
input[type=file].form-control { padding: 7px 10px; height: auto; }
.select2-container .select2-choice, .select2-container-multi .select2-choices, .SumoSelect > .CaptionCont {
    border-radius: var(--radius-sm) !important;
    border-color: #d5dce6 !important;
    min-height: 38px;
    background-image: none !important;
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    padding: 8px 16px;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    text-shadow: none !important;
    background-image: none !important;
}
.btn-sm { padding: 7px 14px !important; font-size: 13px !important; }
.btn-danger, .btn-primary, .mgn-btn, .add-report-button, .submit-button {
    background: var(--brand) !important;
    border: 1px solid var(--brand) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08) !important;
}
.btn-danger:hover, .btn-primary:hover, .mgn-btn:hover, .add-report-button:hover, .submit-button:hover,
.btn-danger:focus, .btn-primary:focus, .mgn-btn:focus {
    background: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
    color: #fff !important;
}
.btn[disabled], .add-report-button[disabled] { opacity: .45; }
.mgn-btn { border-radius: var(--radius-sm) !important; padding: 9px 18px !important; }
.closeBtn.mgn-btn { background: #fff !important; color: var(--text) !important; border-color: #d5dce6 !important; }
.report_btn[data-status="accepted"] { background: var(--accepted) !important; border-color: var(--accepted) !important; }
.report_btn[data-status="declined"], #removeUser, #removeCompany, #removeDecision {
    background: var(--declined) !important;
    border-color: var(--declined) !important;
}
.report_btn[data-status="accepted"]:hover { background: #128a3e !important; }
.report_btn[data-status="declined"]:hover, #removeUser:hover, #removeCompany:hover, #removeDecision:hover { background: #c9363b !important; }
.closeBtn.mgn-btn:hover { background: #f4f6fa !important; }

/* ---------- Tables ---------- */

.table { margin-bottom: 16px; color: var(--text); }
.table > thead > tr > th, .table > thead > tr > td {
    background: #f7f9fc;
    color: var(--muted) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: none !important;
    letter-spacing: .01em;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    padding: 12px 12px !important;
    vertical-align: middle !important;
}
.table > tbody > tr > td {
    border-top: 1px solid #eef1f5 !important;
    padding: 12px 12px !important;
    vertical-align: middle !important;
}
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td { border-color: #eef1f5 !important; }
.table-bordered { border-radius: var(--radius-sm); overflow: hidden; }
.table-striped > tbody > tr:nth-of-type(odd) { background: #fbfcfe; }
.table-hover > tbody > tr:hover, .table tr:hover { background: #f3f7fd !important; }
.table .fa-sort { color: #b7c0cc; }
.table td .label-default {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    border-radius: 6px;
    padding: 3px 7px;
    display: inline-block;
    margin-top: 6px;
}

/* Report rows: a soft tint and a coloured edge instead of a fully painted row. */
tr.status-pending > td, tr#status-pending > td { background: var(--pending-bg) !important; }
tr.status-accepted > td, tr#status-accepted > td { background: var(--accepted-bg) !important; }
tr.status-declined > td, tr#status-declined > td { background: var(--declined-bg) !important; }
tr.status-pending, tr.status-accepted, tr.status-declined, #status-pending, #status-accepted, #status-declined { background: transparent !important; }
tr.status-pending > td:first-child { box-shadow: inset 6px 0 0 var(--pending); }
tr.status-accepted > td:first-child { box-shadow: inset 6px 0 0 var(--accepted); }
tr.status-declined > td:first-child { box-shadow: inset 6px 0 0 var(--declined); }
tr[class^="status-"]:hover > td { filter: brightness(.96); }

.view_report, .options { font-weight: 600; }
.remove_report .fa-trash, .removeUser .fa, .removeCompany .fa, .removeDecision .fa { color: var(--declined) !important; }
.editUser .fa, .editCompany .fa, .editDecision .fa, .regenerate-pass .fa { color: var(--brand) !important; }
.removeUser, .editUser, .editCompany, .removeCompany, .editDecision, .removeDecision, .regenerate-pass {
    border-radius: 8px;
    padding: 6px 0;
    transition: background-color .15s;
}
.removeUser:hover, .editUser:hover, .editCompany:hover, .removeCompany:hover, .editDecision:hover, .removeDecision:hover, .regenerate-pass:hover {
    background: var(--brand-soft);
}
span.active-1 { color: var(--accepted) !important; }
span.active-0 { color: #c0c7d1 !important; }

/* ---------- Pagination and DataTables ---------- */

.pagination > li > a, .pagination > li > span,
.dataTables_paginate a.paginate_button {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 3px !important;
    color: var(--text) !important;
    background: #fff !important;
    min-width: 36px;
    text-align: center;
}
.pagination > .active > a, .pagination > .active > span,
.dataTables_paginate a.paginate_button.current {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
.pagination > li > a:hover { background: var(--brand-soft) !important; }
/* DataTables with Bootstrap puts the button class on the list item too: only the link is the button. */
.dataTables_paginate li.paginate_button { border: none !important; background: none !important; padding: 0 !important; margin: 0 !important; min-width: 0; box-shadow: none !important; }
.dataTables_info { color: var(--muted); }

/* ---------- Labels ---------- */

.label { border-radius: 999px; font-weight: 600; padding: 3px 9px; }
.label-danger, .label-primary { background: var(--brand) !important; }

/* ---------- Popups ---------- */

.mgnPopup {
    border-radius: 16px !important;
    box-shadow: var(--shadow-lg) !important;
    border: none !important;
    padding: 26px 28px !important;
}
.mgnPopup .mgnHeader { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
.mfp-bg { background: #0b1f3a !important; opacity: .55 !important; }
#modal_report .modal-content { border-radius: 16px; border: none; box-shadow: var(--shadow-lg); }

/* ---------- Panel: sidebar ---------- */

.sidebar {
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%) !important;
    border-right: none !important;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04);
}
.sidebar .logo {
    padding: 22px 20px 18px !important;
    margin: 0 !important;
    height: auto !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .logo img { max-width: 100%; height: auto; }
.sidebar-nav { padding: 14px 0 !important; }
.sidebar-nav > li { border: none !important; }
.sidebar-nav > li > a {
    color: rgba(255, 255, 255, .78) !important;
    border: none !important;
    border-radius: 10px;
    margin: 3px 14px;
    padding: 11px 14px 11px 52px !important;
    font-size: 14px;
    transition: background-color .15s, color .15s;
}
.sidebar-nav > li > a:hover { background: rgba(255, 255, 255, .07) !important; color: #fff !important; }
.sidebar-nav > li.active > a {
    background: rgba(255, 255, 255, .13) !important;
    color: #fff !important;
    font-weight: 600;
}
.sidebar-nav > li > a .icon {
    background: transparent !important;
    color: rgba(255, 255, 255, .7) !important;
    left: 14px !important;
    top: 50% !important;
    margin-top: 0 !important;
    transform: translateY(-50%);
    height: auto !important;
    line-height: 1 !important;
    width: 24px !important;
    text-align: center;
}
.sidebar-nav > li.active > a .icon, .sidebar-nav > li > a:hover .icon { color: #fff !important; }
.sidebar-nav > li > a .icon i { color: inherit !important; }
.sidebar-nav > li > a .label {
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
    font-weight: 600;
    top: 50% !important;
    transform: translateY(-50%);
}
.sidebar-nav > li.active > a .label { background: var(--accent) !important; }

/* Collapsed menu: only a 50px strip of the sidebar shows, so each item becomes a centred icon button. */
@media (min-width: 768px) {
    .nav-collapsed .sidebar .logo img { opacity: 0; }
    .nav-collapsed .sidebar-nav > li > a {
        width: 38px;
        height: 40px;
        margin: 4px 6px;
        padding: 0 !important;
        overflow: hidden;
        white-space: nowrap;
        color: transparent !important;
        font-size: 0;
    }
    .nav-collapsed .sidebar-nav > li > a .icon { left: 7px !important; font-size: 16px; }
    .nav-collapsed .sidebar-nav > li > a .label { display: none; }
}

/* ---------- Panel: top bar ---------- */

.page-controls, .page-controls.navbar-default {
    background: rgba(255, 255, 255, .92) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    backdrop-filter: saturate(1.4) blur(6px);
}
.page-controls .nav > li > a { color: var(--muted) !important; }
.page-controls .nav > li > a:hover { color: var(--brand) !important; background: transparent !important; }
.page-controls .navbar-right strong { color: var(--text); font-weight: 600; }
.dropdown-menu {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 6px !important;
}
.dropdown-menu > li > a { border-radius: 8px; padding: 8px 12px !important; }
.dropdown-menu > li > a:hover { background: var(--brand-soft) !important; color: var(--brand) !important; }

/* ---------- Login pages ---------- */

body.login-page, body.login-page .container {
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(29, 95, 176, .16), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(196, 24, 60, .10), transparent 60%),
        var(--bg) !important;
}
body.login-page { min-height: 100vh; }
body.login-page .container { background: transparent !important; }
body.login-page header .logo { margin: 48px auto 28px !important; text-align: center; height: 64px !important; }
body.login-page header .logo img { height: 64px; }
body.login-page .app-name {
    font-size: 22px !important;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--brand-dark);
    text-transform: none !important;
}
.widget-login {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 30px 32px 26px !important;
    opacity: 1 !important;
}
.widget-login > header h3, .widget-login > header h4 {
    margin: 0 0 18px !important;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}
.widget-login header { padding: 0 !important; margin: 0 !important; }
.widget-login .form-group { margin-left: 0 !important; margin-right: 0 !important; }
.widget-login .form-control { height: 44px; font-size: 15px; }
.widget-login .btn { width: 100%; padding: 11px 16px !important; font-size: 15px !important; }
.widget-login .btn-toolbar { float: none !important; margin: 0; }
.widget-login .btn-inverse {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
.widget-login .btn-inverse:hover { background: var(--brand-dark) !important; }
body.login-page .page-footer {
    border-top: none !important;
    color: var(--muted);
    text-align: center;
    padding-top: 28px !important;
}
body.login-page .page-footer .rights { color: var(--muted) !important; }

/* ---------- Organization pages ---------- */

.page-wrap { background: transparent; }
body > header, .page-wrap > header { background: transparent; }
header .logo { margin-top: 24px; }
.heading { border-bottom: none !important; margin-top: 70px !important; padding-bottom: 8px !important; }
.heading span { font-size: 20px !important; font-weight: 600; color: var(--brand-dark); }

.portal-logo { display: inline-block; margin: 22px 0 6px; }
.portal-logo img { height: 52px; width: auto; }
.nav-top-container { min-height: 84px; }
.nav-top-container .user-info { bottom: 18px; }
.nav-top-container .user-info p { color: var(--muted); font-size: 13px; }
.user-info .dropdown-toggle {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--brand);
}

.nav-container { height: auto !important; margin: 10px 0 26px; }
.nav-items {
    display: inline-flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 5px !important;
}
.nav-items > a { text-decoration: none !important; }
.nav-item {
    float: none !important;
    background: transparent !important;
    color: var(--text) !important;
    border: none !important;
    border-radius: 10px;
    text-transform: none !important;
    font-weight: 600;
    font-size: 14px !important;
    padding: 10px 18px !important;
    transition: background-color .15s, color .15s;
    list-style: none;
}
.nav-item:hover { background: var(--brand-soft) !important; color: var(--brand) !important; }
.nav-item.active { background: var(--brand) !important; color: #fff !important; }
.nav-item.user { display: none; }

.decisions-wrapper, .report-history-container, .wrapper-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px !important;
    margin: 0 0 24px !important;
}
.wrapper-header { padding: 16px 22px !important; }
.header-divider { display: none; }
.decisions-footer { display: none; }
.decisions-container .table { margin: 0; }
.decisions-wrapper .decisions-container, .report-history-container .widget-body, .report-history-container .mt {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.decisions-container .table > thead > tr > th { border-top: none !important; }
.file-download { font-weight: 600; }
.fileName {
    display: inline-block;
    border: 1px dashed #c5cfdc;
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--brand) !important;
    background: #f8fafd;
    font-weight: 600;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.fileName:hover { border-color: var(--brand); background: var(--brand-soft); }
.success-report {
    padding: 28px !important;
    border: none !important;
    background: var(--accepted-bg);
    color: #14532d;
    border-radius: var(--radius) !important;
    text-align: center;
}
.no-decisions, .no-companies { color: var(--muted); padding: 20px 0; text-align: center; }

.site-footer { background: transparent; }
.footer-container { border-top: 1px solid var(--border) !important; padding-top: 16px !important; }
.rights { color: var(--muted); font-size: 13px; }

/* Login cards: no extra space above or inside. */
.widget-login-container, body.login-page .widget-login-container { padding-top: 10px !important; margin-top: 0 !important; }
body.login-page .widget-login-container { padding-bottom: 20px !important; }
.widget-login .widget-body { padding: 0 !important; margin: 0 !important; }
.widget-login .widget-body form { margin: 0 !important; }
.widget-login .form-group:last-of-type { margin-bottom: 18px; }
.widget-login .clearfix { margin: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
    .nav-top-container { min-height: 0; }
    .portal-logo { margin: 14px 0 4px; }
    .portal-logo img { height: 40px; }
    .nav-top-container .user-info { position: static !important; padding: 0 15px 6px !important; text-align: right; }
    .nav-top-container .user-info p, .nav-top-container .user-info .dropdown { display: inline-block; vertical-align: middle; margin-left: 8px; }
    .decisions-container, .report-history-container .widget-body, .report-history-container .mt, .widget-body .mt, .tab-pane-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .page-title { font-size: 22px !important; }
    .widget, .tab-content { padding: 14px !important; }
    .nav-items { display: flex !important; border-radius: 12px; }
    .nav-item { padding: 9px 12px !important; font-size: 13px !important; }
    .heading { margin-top: 40px !important; }
    .widget-login { padding: 22px 18px !important; }
}

/* ---------- Dashboard (Ընդհանուր) ---------- */

.dash-note { color: var(--muted); margin: -6px 0 18px; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-tile {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; color: var(--text) !important; text-decoration: none !important;
    transition: box-shadow .15s, transform .15s;
}
a.dash-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.dash-tile-label { font-size: 13px; color: var(--muted); }
.dash-tile-value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--brand-dark); }
.dash-tile-split { font-size: 12px; color: var(--muted); line-height: 1.6; }
.dash-tile-pending { border-left: 6px solid var(--pending); }
.dash-tile-pending .dash-tile-value { color: #7a5d00; }

.dash-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dash-pending { background: var(--pending); }
.dash-accepted { background: var(--accepted); }
.dash-declined { background: var(--declined); }

.dash-card { padding: 18px 20px !important; margin-bottom: 20px !important; overflow-x: auto; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dash-card-head h5 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.dash-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.dash-badge { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--declined-bg); color: #a3262a; font-size: 13px; }
.dash-muted { color: var(--muted); font-size: 12px; }
.dash-empty { color: var(--muted); margin: 6px 0; }
.dash-nowrap { white-space: nowrap; }

.dash-chart { display: flex; align-items: stretch; gap: 10px; height: 240px; padding-top: 6px; }
.dash-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.dash-col-total { font-size: 11px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.dash-bar {
    width: 100%; max-width: 46px; min-height: 2px; display: flex; flex-direction: column;
    border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--border);
}
.dash-bar > span { display: block; min-height: 2px; }
.dash-col-label { font-size: 11px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.dash-grid > .dash-card { margin-bottom: 20px !important; }
.dash-table { margin: 0 !important; }
.dash-table td, .dash-table th { padding: 8px 10px !important; vertical-align: top !important; }
.dash-table .label { margin-left: 4px; }
.dash-form-name { font-size: 11px; color: var(--muted); line-height: 1.35; }
.dash-scroll { max-height: 420px; overflow-y: auto; }
.dash-year select { min-width: 90px; }
.dash-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.dash-status-pending { background: var(--pending-bg); color: #7a5d00; }
.dash-status-accepted { background: var(--accepted-bg); color: #116b33; }
.dash-status-declined { background: var(--declined-bg); color: #a3262a; }

@media (max-width: 1199px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .dash-chart { gap: 4px; height: 180px; }
    .dash-col-total { display: none; }
    .dash-col-label { font-size: 9px; white-space: normal; text-align: center; line-height: 1.15; word-spacing: 100vw; }
}
