/* =========================================================

   ========================================================= */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --text: #404040;
    --muted: #4373a3;
    --border: #e5e7eb;
    --borderfocus: #42BDCB;
    --borderfocuslight:#dbf0db;
    --borderwhite: #ffffff;
    --titled: #4373a3;

    --primary: #4373a3;
    --primarylight:#edf2f8;
    --primary-600: #65cb43;
    --primary-600light: #fbe9ea;
    --primary-100: #fff1e6;
    --modal:#768238;
   --btndefault: #e15155;
   --btndefaultlight:#fbe9ea;
   --btndefaulthover:#a47864;
   --btnactive:#42BDCB;
   --navbar:#42BDCB;
   
    --danger: #e15155;
    --success: #65cb43;
    --warning: #f59e0b;

    /* Radius scale */
    --radius-xs: 1px;
    --radius-sm: 0px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 1px;
    --radius-pill: 999px;
    --radius-circle: 9999px;

    /* Semantic radius aliases */
    --radius: var(--radius-sm);
    --radius-btn: var(--radius-xs);
    --radius-input: var(--radius-xs);
    --radius-panel: var(--radius-sm);
    --radius-modal: var(--radius-lg);
    --radius-dropdown: var(--radius-lg);
    --radius-tag: var(--radius-pill);

    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    --font-size: 13px;
    --font-size-small: 11px;
    --font-weight-small: 500;
    --font-weight-normal: 600;
    --line-height: 1.35;

    --shadow: 0 10px 24px rgba(0,0,0,.08);
    --shadow-sm: 0 6px 16px rgba(0,0,0,.08);
    --focus: 0 0 0 3px rgba(67, 163, 139,.25);

    --sidebar-w: 220px;
    --topbar-h: 50px;
    --pad: 7px;
    --control-h: 25px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--font-size);
    line-height: var(--line-height);
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

.hidden {
    display: none !important;
}

/* =========================================================
   Layout
   ========================================================= */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns .25s ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 12px;
    transition: width .25s ease;
}

.main {
    min-width: 0;
}

.content {
    padding: var(--pad);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }
}

/* =========================================================
   Brand
   ========================================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
   background: var(--surface);
    border: 1px solid var(--surface);
    margin-bottom: 10px;
}

.brand-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xl);
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
}

.brand-title {
    font-weight: 900;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

/* =========================================================
   Top Navbar
   ========================================================= */
.navbar {
    min-height: var(--topbar-h);
    height: var(--topbar-h);
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--navbar);
    background: var(--navbar);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad);
    position: sticky;
    top: 0;
    z-index: 20;
}

.navbar .navbar-brand {
    font-weight: 600;
    font-size: 13px;
    padding: 0;
    height: auto;
    line-height: 1.5;
    margin-right: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color:#ffffff;
}

.navbar .nav {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.navbar .nav > li {
    position: relative;
}

.navbar .nav > li > a {
    display: inline-flex;
    align-items: center;
    height: var(--topbar-h);
    padding: 0 10px;
    border-radius: var(--radius-btn);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
}

.navbar .nav > li > a:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: calc(var(--topbar-h) - 2px);
    left: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 50;
}

.open > .dropdown-menu {
    display: block;
}

.dropdown-menu > li {
    list-style: none;
}

.dropdown-menu > li > a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-lg);
    color: var(--text);
    font-weight: 600;
}

.dropdown-menu > li > a:hover {
    background: var(--surface-2);
}

/* =========================================================
   Sidebar menu
   ========================================================= */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--text);
    font-weight: 600;
}

.menu a:hover {
    background: var(--surface-2);
    border-color: var(--borderwhite);
}

.menu .active > a {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

.menu small {
    font-weight: 700;
    color: var(--muted);
}

.submenu {
    list-style: none;
    padding: 6px 0 10px 34px;
    margin: 0;
}

.submenu a {
    font-weight: 500;
    color: var(--muted);
    padding: 8px 10px;
}

.submenu a:hover {
    color: var(--text);
}
.submenu .active > a {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}

/* Collapse helper */
.collapse {
    display: none;
}

.collapse.in {
    display: block;
}

.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height .35s ease;
}

/* =========================================================
   Grid
   ========================================================= */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.row:before,
.row:after {
    content: " ";
    display: table;
}

.row:after {
    clear: both;
}

[class*="col-"] {
    padding-left: 5px;
    padding-right: 5px;
    min-height: 1px;
    float: left;
}

.col-xs-12 { width: 100%; }
.col-xs-6 { width: 50%; }
.col-xs-4 { width: 33.3333%; }
.col-xs-3 { width: 25%; }

@media (min-width: 992px) {
    .col-md-12 { width: 100%; }
    .col-md-8  { width: 66.6667%; }
    .col-md-6  { width: 50%; }
    .col-md-4  { width: 33.3333%; }
    .col-md-3  { width: 25%; }
}

@media (max-width: 720px) {
    [class*="col-"] {
        width: 100% !important;
        float: none;
    }
}

/* =========================================================
   Panels
   ========================================================= */
.panel {
    border: 1px solid var(--borderwhite);
    border-radius: var(--radius-panel);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 16px;
}

.panel-heading {
    padding: 5px 7px;
    border-bottom: 1px solid var(--borderwhite);
    background: linear-gradient(180deg, #fff, var(--surface-2));
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--titled);
}

.panel-body {
    padding: 14px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    height: var(--control-h);
    padding: 0 12px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--primary);
    background: var(--primary);
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    color: #ffffff;
    
}

.btn:focus {
    outline: none;
    
}

.btn:hover {
        background: var(--btndefaulthover);
    color: #ffffff;
    border: 1px solid var(--btndefaulthover);
}

.btn-primary {
    background: var(--btndefault);
    border: 1px solid var(--btndefault);
    color: #fff;
    
}

.btn-primary:hover {
    background: var(--primary-600);
    border: 1px solid var(--primary-600);
}

.btn-default {
    background: var(--primary);
   color:#ffffff;
   border:1px solid var(--primary);
}
.btn-default:hover{
    background: var(--btndefaulthover);
   color:#ffffff;
   border:1px solid var(--btndefaulthover);
   
}
.btn-link {
    border: 1px solid transparent;
    background: transparent;
    color: var(--primary-600);
    
}

.btn-link:hover {
    background: transparent;
    text-decoration: underline;
}

.btn.is-active,
.btn[aria-pressed="true"] {
    background: var(--btnactive);
    border: 1px solid var(--btnactive);
    color: #ffffff;
}

.btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
    border: 1px solid #f3f4f6;
}

/* =========================================================
   Forms
   ========================================================= */
form {
    margin: 5px;
}

.has-right-border {
   border-right: 1px solid var(--border);
}

.form-group {
    margin-bottom: 5px;
}

input.error,
select.error,
textarea.error {
    border-color: #43a38b;
}

label,
.control-label {
    display: block;
    margin-bottom: 6px;
   font-weight: var(--font-weight-small);
    font-size: var(--font-size-small);
}

.help-block {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.help-block.error { color: var(--danger); }
.help-block.success { color: var(--success); }
.help-block.warning { color: var(--warning); }

.form-control {
    width: 100%;
    height: var(--control-h);
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    background: #fff;
    color: var(--text);
    font-size: 12px;
    transition: .15s ease;
}

.form-control:focus {
    outline: none;
    
    border-color: var(--borderfocus);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
}

.form-control[readonly] {
    background: #f9fafb;
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 10px 12px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 34px;
    background:#ffffff;
    
}
select.form-control:focus{
background: var(--primary-600light);
    color: var(--primary-600);
    
}    

    
    
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    appearance: none;
    -webkit-appearance: none;
    min-height: var(--control-h);
    line-height: normal;
    padding-right: 10px;
}

.has-success .form-control { border-color: var(--success); }
.has-warning .form-control { border-color: var(--warning); }
.has-error .form-control { border-color: var(--danger); }

.has-success .help-block { color: var(--success); }
.has-warning .help-block { color: var(--warning); }
.has-error .help-block { color: var(--danger); }

.checkbox,
.radio,
.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    user-select: none;
}

.checkbox input,
.radio input,
.choice input[type="checkbox"],
.choice input[type="radio"],
input[type="checkbox" i]{
    margin: 0;
    width: 13px;
    height: 13px;
    accent-color: var(--primary);
    cursor: pointer;
    
}

.choice-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px 16px;
    align-items: baseline;
}

.choice-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 14px;
}

.form-control-static {
    min-height: var(--control-h);
    display: flex;
    align-items: center;
    color: var(--text);
    font-weight: 600;
    padding: 0 2px;
}

.form-control.input-sm,
.btn.btn-sm {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
}

.form-control.input-lg,
.btn.btn-lg {
    height: 42px;
    font-size: 15px;
    padding: 0 14px;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.form-horizontal .form-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.form-horizontal .control-label {
    width: 160px;
    text-align: right;
    margin-bottom: 0;
}

.form-horizontal .form-control-wrapper {
    flex: 1;
}

/* Extended form layout */
.form-section-title {
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 5px;
    color: var(--text);
}

.form-section-title {
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 12px;
    color: var(--titled);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.form-col {
    flex: 1 1 220px;
    min-width: 220px;
}

/* Input groups */
.input-group {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.input-group-addon {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: #f9fafb;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.input-group .input-group-addon:first-child {
    border-right: 0;
    border-radius: var(--radius-input) 0 0 var(--radius-input);
}

.input-group .form-control:not(:first-child):not(:last-child) {
    border-radius: 0;
}

.input-group .form-control:first-child:not(:last-child) {
    border-radius: var(--radius-input) 0 0 var(--radius-input);
}

.input-group .form-control:last-child:not(:first-child) {
    border-radius: 0 var(--radius-input) var(--radius-input) 0;
}

.input-group .input-group-addon:last-child {
    border-left: 0;
    border-radius: 0 var(--radius-input) var(--radius-input) 0;
}

.input-group-btn .btn {
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

/* Button groups */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    margin-left: 0;
    border-top-left-radius: var(--radius-btn);
    border-bottom-left-radius: var(--radius-btn);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-btn);
    border-bottom-right-radius: var(--radius-btn);
}

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px 14px;
    margin: 0 0 16px 0;
    min-width: 0;
}

legend {
    font-size: 13px;
    font-weight: 900;
    padding: 0 6px;
    color: var(--text);
}

label.error {
    color: red !important;
}

/* =========================================================
   Custom modal
   ========================================================= */
.x-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.x-modal.is-open {
    display: block;
}

.x-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.x-modal-dialog {
    position: relative;
    width: 640px;
    max-width: calc(100% - 30px);
    margin: 48px auto;
    z-index: 1;
}

.x-modal-content {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    overflow: hidden;
}

.x-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navbar);
}

.x-modal-header .close {
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.x-modal-header .close:hover {
    color: #111827;
}

.x-modal-body {
    padding: 18px;
}

.x-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.x-modal-title {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    color:#ffffff;
}

body.modal-open {
    overflow: hidden;
}

/* =========================================================
   Story view
   ========================================================= */
.story {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .story {
        grid-template-columns: 1fr;
    }
}

.story-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.story-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.story-item:hover {
    background: var(--surface-2);
}

.story-item.active {
    background: var(--primarylight);
    border-left: 4px solid var(--primary);
    padding-left: 8px;
}

.story-item-title {
    font-weight: 600;
}

.story-item-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.story-detail {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.story-detail-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color:#ffffff;
   
}

.story-detail-title {
    font-weight: 600;
}

.story-detail-body {
    padding: 14px;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-tag);
    background: #fff;
    font-weight: 800;
    font-size: 12px;
    color: var(--muted);
}

.tag.primary {
   background: var(--btndefault);
    border-color: var(--btndefault);
    color: #ffffff;
}

.timeline {
    margin-top: 14px;
    padding-left: 0;
    list-style: none;
}

.timeline li {
    position: relative;
    padding: 10px 10px 10px 26px;
    border-bottom: 1px dashed var(--border);
}

.timeline li:last-child {
    border-bottom: 0;
}

.timeline li:before {
    content: "";
    position: absolute;
    left: 10px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-circle);
    background: var(--btndefault);
}

.timeline-title {
    font-weight: 900;
    font-size: 13px;
}

.timeline-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}
    .story-content,
.story-detail,
.story-detail-body,
#loadInfo {
    overflow: visible !important;
}
.panel,
.panel-body,
.story-content,
.story-detail-body,
#loadInfo {
    overflow: visible !important;
}

/* =========================================================
   Sidebar collapse mode
   ========================================================= */
body.sidebar-collapsed .app {
    grid-template-columns: 70px 1fr;
}

body.sidebar-collapsed .brand-title,
body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .menu span,
body.sidebar-collapsed .menu small {
    display: none;
}

body.sidebar-collapsed .menu a {
    justify-content: center;
    padding: 12px 6px;
}

body.sidebar-collapsed .menu a span.text-muted {
    display: none;
}

body.sidebar-collapsed .submenu {
    display: none !important;
}

body.sidebar-collapsed .brand {
    justify-content: center;
}

/* =========================================================
   Table Lite
   ========================================================= */
.tl {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.tl-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 7px;
   
    background: linear-gradient(180deg, #fff, var(--surface-2));
}

.tl-toolbar .left,
.tl-toolbar .right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.tl-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
}

.tl-input,
.tl-select {
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0 10px;
    background: #fff;
    color: var(--text);
}

.tl-input:focus,
.tl-select:focus {
    outline: none;
    border-color: var(--borderfocus);
    box-shadow: none;
}

.tl-table {
    width: 100%;
    border-collapse: collapse;
}

.tl-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
}

.tl-table thead th:hover {
    background: var(--surface-2);
}

.tl-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tl-sort .caret {
    font-size: 11px;
    color: var(--muted);
}

.tl-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    vertical-align: top;
}

.tl-table tbody tr:nth-child(even) td {
    background: var(--primarylight);
}

.tl-table tbody tr:hover td {
    background: var(--btndefaultlight);
}

.tl-empty {
    padding: 18px 12px;
    color: var(--muted);
}

.tl-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #fff;
}

.tl-pager {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.tl-btn {
    height: var(--control-h);
    padding: 0 10px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-xl);
    background: #ffffff;
    cursor: pointer;
    font-weight: var(--font-weight-small);
    font-size: var(--font-size-small);
    color:var(--primary);
}

.tl-btn:hover {
    background: #ffffff;
}

.tl-btn:disabled {
    opacity: .75;
    cursor: not-allowed;
}

.tl-page {
    min-width: 44px;
    text-align: center;
    font-weight: var(--font-weight-small);
    font-size: var(--font-size-small);
    color: var(--primary);
}

.tl-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 900;
    font-size: 12px;
    color: var(--muted);
}

.tl-pill.primary {
    border-color: rgba(224,122,47,.35);
    background: rgba(224,122,47,.10);
    color: var(--primary-600);
}

.tl-scroll {
    max-height: 520px;
    overflow: auto;
    border-top: 1px solid var(--border);
}

.tl-colmenu {
    position: relative;
}

.tl-colpanel {
    position: absolute;
    right: 0;
    top: calc(var(--control-h) + 8px);
    width: 240px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
    z-index: 30;
}

.tl-colpanel.open {
    display: block;
}

.tl-colitem {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    border-radius: var(--radius-lg);
}

.tl-colitem:hover {
    background: var(--surface-2);
}

/* =========================================================
   Login layout
   ========================================================= */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, var(--primarylight), #fff 35%);
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, var(--surface-2));
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction:column;
}

.login-body {
    padding: 16px;
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* =========================================================
   Custom datepicker v2
   ========================================================= */
.dp {
    position: relative;
}

.dp-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 120;
    width: 250px;
}

.dp-popup.hidden {
    display: none;
}

.dp-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--primary);
    border-bottom: 1px solid var(--border);
    
}

.dp-selects {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.dp-select {
    height: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    padding: 0 8px;
    max-width: 120px;
}

.dp-select:focus {
    outline: none;
    
    border-color: var(--primary);
}

.dp-nav {
    width: 30px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    line-height: 1;
}

.dp-nav:hover:not(:disabled) {
    background: var(--surface-2);
}

.dp-nav:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 6px 6px 0;
}

.dp-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
    padding: 6px 0;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 6px;
}

.dp-day {
    height: 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
}

.dp-day:hover:not(:disabled) {
    background: var(--btndefault);
    border-color: var(--btndefault);
    color: var(--surface);
}

.dp-day.is-muted {
    color: #b2b8c2;
}

.dp-day.is-today {
    border-color: var(--surface);
    color: var(--btndefault);
    background-color: var(--surface);
    font-weight: var(--font-weight-normal);
}

.dp-day.is-selected {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--surface);
}

.dp-day.is-disabled,
.dp-day:disabled {
    color: #c5cad3;
    background: #f9fafb;
    cursor: not-allowed;
    opacity: .75;
}

.dp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
    background: #fff;
    gap: 8px;
}

.dp-footer-btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
   font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
}

.dp-footer-btn:hover:not(:disabled) {
    background: var(--surface-2);
}

.dp-footer-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.dp-today {
   background: var(--btndefault);
    border-color: var(--btndefault);
    color: var(--surface);
}
.dp-today:hover:not(:disabled) {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--surface);
}
/* =========================================================
   Select Lite v2
   ========================================================= */
.sl {
    position: relative;
    width: 100%;
}

.sl-control {
    width: 100%;
    min-height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    padding: 4px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
}

.sl-control:focus {
    outline: none;
    
    border-color: var(--borderfocus);
}

.sl-value-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
   
}

.sl-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sl-value.is-placeholder {
    color: #9ca3af;
}

.sl-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sl-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    background: rgba(224,122,47,.10);
    border: 1px solid rgba(224,122,47,.25);
    color: var(--primary-600);
    font-size: 12px;
    font-weight: 800;
    max-width: 100%;
}

.sl-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sl-pill-remove {
    cursor: pointer;
    font-weight: 900;
    line-height: 1;
}

.sl-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sl-clear {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
}

.sl-clear:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sl-arrow {
    color: var(--muted);
    font-size: 12px;
}

.sl-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    
    z-index: 9999;
    overflow: hidden;
}

.sl-dropdown.hidden {
    display: none;
}

.sl-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, var(--surface-2));
}

.sl-search {
    width: 100%;
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    padding: 0 10px;
    font-size: 12px;
}

.sl-search:focus {
    outline: none;
    
    border-color: var(--primarylight);
}

.sl-list {
    max-height: min(320px, 40vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    scroll-behavior: smooth;
}

.sl-group {
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sl-option {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sl-option:hover,
.sl-option.is-highlighted {
    background: var(--primary-600light);
}

.sl-option.is-selected {
    background: var(--primary-600light);
    color: var(--btndefault);
}

.sl-option.is-disabled {
    color: #b6bcc6;
    cursor: not-allowed;
}

.sl-option.hidden {
    display: none;
}

.sl-check {
    width: 16px;
    text-align: center;
    font-weight: 900;
    color: var(--primary-600);
    flex-shrink: 0;
}

.sl-option-label {
    min-width: 0;
    
}

.sl.is-open .sl-control {
    
    border-color: var(--primarylight);
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}
.text-warning {
    color: var(--warning);
}
/* =========================================================
   ECS Modern UI Refresh - June 2026
   Global override layer. Keeps legacy class names intact.
   ========================================================= */
:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef4ff;
    --text: #152033;
    --muted: #64748b;
    --border: #dbe4f0;
    --borderfocus: #2563eb;
    --borderfocuslight: #dbeafe;
    --borderwhite: #e6edf7;
    --titled: #0f2f5f;
    --primary: #1e3a8a;
    --primarylight: #eff6ff;
    --primary-600: #2563eb;
    --primary-600light: #dbeafe;
    --primary-100: #e0f2fe;
    --modal: #1e3a8a;
    --btndefault: #2563eb;
    --btndefaultlight: #eef6ff;
    --btndefaulthover: #1d4ed8;
    --btnactive: #0f766e;
    --navbar: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-panel: 18px;
    --radius-btn: 12px;
    --radius-input: 12px;
    --font-size: 14px;
    --font-size-small: 12px;
    --font-weight-small: 650;
    --font-weight-normal: 600;
    --line-height: 1.5;
    --shadow: 0 18px 45px rgba(15, 23, 42, .10);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .08);
    --focus: 0 0 0 4px rgba(37, 99, 235, .16);
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --pad: 22px;
    --control-h: 40px;
}

html { background: var(--bg); }
body {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 30rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 34rem);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #13213a 55%, #172554 100%);
    border-right: 0;
    padding: 18px 14px;
    box-shadow: 12px 0 35px rgba(15, 23, 42, .16);
}
.main { min-height: 100vh; }
.content { padding: var(--pad); }
.container { max-width: 1440px; }

.brand {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 18px;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255,255,255,.12) !important;
    box-shadow: none;
}
.brand-badge img { max-height: 34px !important; max-width: 38px; object-fit: contain; }
.brand-title { color: #ffffff; font-size: 14px; letter-spacing: .01em; }
.brand-subtitle { color: #bfdbfe; }

.navbar {
    background: rgba(255,255,255,.86);
    border-bottom: 1px solid rgba(219, 228, 240, .9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    backdrop-filter: blur(16px);
    padding: 0 24px;
}
.navbar .navbar-brand {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.navbar .nav > li > a,
.navbar .nav > li > button {
    color: var(--text);
}

.menu { gap: 6px; }
.menu a {
    color: #cbd5e1;
    border-radius: 14px;
    padding: 11px 12px;
    font-weight: 700;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.menu a:hover {
    background: rgba(255,255,255,.09);
    border-color: transparent;
    color: #ffffff;
    transform: translateX(2px);
}
.menu .active > a,
.menu a.is-active {
    background: linear-gradient(135deg, #2563eb, #0f766e);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .25);
}
.menu small,
.menu .text-muted { color: #93c5fd; }
.submenu {
    padding: 6px 0 10px 16px;
    border-left: 1px solid rgba(255,255,255,.10);
    margin-left: 16px;
}
.submenu a { color: #aab8cc; padding: 8px 10px; font-weight: 650; }
.submenu a:hover { color: #ffffff; background: rgba(255,255,255,.07); }

.panel,
.story-list,
.story-detail,
.tl,
.login-card,
.dp-card,
.x-modal-content,
.modal-content {
    border: 1px solid rgba(219, 228, 240, .9);
    border-radius: var(--radius-panel);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-sm);
}
.panel { margin-bottom: 20px; overflow: hidden; }
.panel-heading,
.tl-toolbar,
.login-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: var(--titled);
    font-size: 14px;
    font-weight: 800;
}
.panel-body { padding: 18px; }

.btn,
.tl-btn,
.dp-footer-btn,
.dp-nav {
    min-height: var(--control-h);
    height: auto;
    border-radius: var(--radius-btn);
    font-weight: 750;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}
.btn:hover,
.tl-btn:hover,
.dp-footer-btn:hover,
.dp-nav:hover { transform: translateY(-1px); }
.btn-primary,
.btn-default,
.btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}
.btn-default {
    background: #ffffff;
    color: #1e3a8a;
    border-color: #cbdaf0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}
.btn-primary:hover,
.btn:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); border-color: #1d4ed8; color: #fff; }
.btn-default:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.btn-block { width: 100%; }
.btn-sm, .btn.btn-sm { min-height: 34px; padding: 6px 12px; }

.form-control,
.tl-input,
.tl-select,
.sl-control,
.dp-select {
    min-height: var(--control-h);
    height: auto;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(15,23,42,.03);
}
.form-control:focus,
.tl-input:focus,
.tl-select:focus,
.sl-control:focus,
.dp-select:focus {
    border-color: var(--borderfocus);
    box-shadow: var(--focus);
    background: #ffffff;
    color: var(--text);
}
label,
.control-label {
    color: #334155;
    letter-spacing: .01em;
    text-transform: none;
}
textarea.form-control { min-height: 110px; }

.table-responsive, .tl-scroll { border-radius: 0 0 var(--radius-panel) var(--radius-panel); }
.table,
.tl-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th,
.tl-table thead th {
    background: #f8fafc;
    color: #475569;
    padding: 13px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.table tbody td,
.tl-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #243247;
}
.tl-table tbody tr:nth-child(even) td { background: #fbfdff; }
.tl-table tbody tr:hover td,
.table tbody tr:hover td { background: #eff6ff; }

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.alert-success { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.tag,
.tl-pill {
    border-radius: 999px;
    background: #f8fafc;
    border-color: #dbe4f0;
    color: #475569;
    font-weight: 800;
}
.tag.primary,
.tl-pill.primary { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }

.story { gap: 18px; }
.story-item { padding: 14px 16px; }
.story-item.active { background: #eff6ff; border-left-color: #2563eb; }
.story-detail-head,
.dp-header,
.x-modal-header,
.modal-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
}
.x-modal-title,
.modal-title { color: #ffffff; font-weight: 800; }
.x-modal-header .close,
.modal-header .close { color: #ffffff; opacity: .9; }

.login-wrap {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.25), transparent 24rem),
        linear-gradient(135deg, #eef6ff, #f8fafc 50%, #e0f2fe);
}
.login-card { width: min(460px, 100%); }
.login-head { padding: 24px 20px; }
.login-body { padding: 22px; }

.account-action-tab,
.account-action-form,
.form-section {
    border-radius: 18px;
}
.account-action-tab.is-active,
.account-action-tab.active {
    background: linear-gradient(135deg, #2563eb, #0f766e);
    color: #ffffff;
    border-color: transparent;
}
.timeline li:before { background: #2563eb; box-shadow: 0 0 0 4px #dbeafe; }

@media (max-width: 900px) {
    :root { --sidebar-w: 1fr; --pad: 14px; --topbar-h: auto; }
    .app { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; border-radius: 0 0 24px 24px; }
    .navbar { position: sticky; top: 0; min-height: 58px; padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
    .navbar .nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .content { padding: 14px; }
}

@media print {
    body { background: #fff; }
    .sidebar, .navbar { display: none !important; }
    .app { display: block; }
    .content { padding: 0; }
    .panel, .story-detail, .tl { box-shadow: none; border-color: #ccc; }
}
