/* ==================================================================
   Dalalia brand layer
   Loaded after style.css / skin_color.css so it always wins.

   Corporate palette: #168fc8 (primary) and #ffffff (surface).
   The shade ramp below is derived from the primary so hover, active and
   tint states stay consistent with the theme's own expectations.
   ================================================================== */

:root {
    --brand:            #168fc8;
    --brand-dark:       #1278a8;
    --brand-darker:     #106891;
    --brand-muted:      #96cde6;
    --brand-tint:       #ecf6fb;
    --brand-tint-strong:#d7ecf6;

    --surface:          #ffffff;
    --ink:              #1c2b36;
    --ink-soft:         #6b7c88;
    --line:             #e6edf2;

    --ok:               #17c653;
    --warn:             #f6c000;
    --bad:              #f8285a;

    --radius:           10px;
    --shadow-card:      0 1px 2px rgba(28, 43, 54, .04), 0 2px 8px rgba(28, 43, 54, .06);
}

/* ---------- Typography -------------------------------------------- */

body {
    color: var(--ink);
    background-color: #f4f7f9;
}

.page-title {
    font-weight: 700;
    color: var(--ink);
}

.text-fade { color: var(--ink-soft) !important; }

.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Brand utilities ---------------------------------------- */

.text-brand    { color: var(--brand) !important; }
.bg-brand      { background-color: var(--brand) !important; color: #fff !important; }
.bg-brand-tint { background-color: var(--brand-tint) !important; }
.border-brand  { border-color: var(--brand) !important; }

/* ---------- Header -------------------------------------------------- */

.main-header .logo-box,
.main-header .logo {
    background-color: var(--surface);
}

.main-header .logo-lg img { max-height: 34px; width: auto; }
.main-header .logo-mini img { max-height: 30px; width: auto; }

.main-header .navbar { background-color: var(--surface); }

.avatar-initials {
    display: inline-grid;
    place-items: center;
    height: 38px;
    width: 38px;
    border-radius: 50%;
    background-color: var(--brand-tint);
    color: var(--brand-darker);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
}

.user-menu .dropdown-menu { min-width: 250px; padding-bottom: 6px; }
.user-menu .dropdown-item { display: flex; align-items: center; gap: 10px; }
.user-menu .dropdown-item svg { height: 16px; width: 16px; }

/* ---------- Sidebar -------------------------------------------------- */

.main-sidebar,
.sidebar-menu > li.header {
    background-color: var(--brand);
}

.sidebar-menu > li.header {
    color: rgba(255, 255, 255, .62);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    padding: 18px 20px 8px;
}

.sidebar-menu > li > a {
    color: rgba(255, 255, 255, .86);
    border-radius: 8px;
    margin: 2px 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-menu > li > a > svg,
.sidebar-menu > li > a > i {
    height: 18px;
    width: 18px;
    flex: 0 0 auto;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li > a:focus-visible {
    background-color: rgba(255, 255, 255, .12);
    color: #fff;
}

.sidebar-menu > li.active > a {
    background-color: var(--surface);
    color: var(--brand-darker);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* Collapsed (mini) sidebar keeps icons centred */
.sidebar-mini.sidebar-collapse .sidebar-menu > li > a { justify-content: center; }
.sidebar-mini.sidebar-collapse .sidebar-menu > li.header { visibility: hidden; height: 12px; padding: 0; }

.sidebar-widget { padding: 16px 12px 24px; }

.plan-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background-color: rgba(255, 255, 255, .12);
    color: #fff;
    transition: background-color .15s ease;
}

.plan-chip:hover { background-color: rgba(255, 255, 255, .2); color: #fff; }

.plan-chip-icon {
    display: grid;
    place-items: center;
    height: 34px;
    width: 34px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, .18);
    flex: 0 0 auto;
}

.plan-chip-icon svg { height: 17px; width: 17px; }
.plan-chip-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.plan-chip-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.plan-chip-name { font-size: 13px; font-weight: 700; }
.plan-chip-arrow { margin-left: auto; height: 16px; width: 16px; opacity: .8; }

.sidebar-mini.sidebar-collapse .sidebar-widget { display: none; }

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

.btn-primary,
.btn-brand {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-brand:hover,   .btn-brand:focus,   .btn-brand:active {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-outline-brand {
    background-color: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.btn-outline-brand:hover { background-color: var(--brand); color: #fff; }

.btn-outline-light-brand {
    background-color: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
}

.btn-outline-light-brand:hover { background-color: rgba(255, 255, 255, .26); color: #fff; }

.btn-primary-light {
    background-color: var(--brand-tint);
    color: var(--brand-darker);
    border-color: transparent;
}

.btn-primary-light:hover { background-color: var(--brand-tint-strong); color: var(--brand-darker); }

.btn svg { height: 16px; width: 16px; vertical-align: -3px; }

/* ---------- Boxes / cards -------------------------------------------- */

.box {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

.box-header { border-bottom: 1px solid var(--line); }
.box-header.with-border { border-bottom: 1px solid var(--line); }
.box-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.box-footer { border-top: 1px solid var(--line); background-color: #fbfdfe; }

/* KPI tiles */
.kpi {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.kpi-icon {
    display: grid;
    place-items: center;
    height: 42px;
    width: 42px;
    border-radius: 11px;
    flex: 0 0 auto;
}

.kpi-icon svg { height: 20px; width: 20px; }
.kpi-icon.is-brand { background-color: var(--brand-tint);       color: var(--brand-darker); }
.kpi-icon.is-ok    { background-color: rgba(23, 198, 83, .12);  color: #0f9c3f; }
.kpi-icon.is-warn  { background-color: rgba(246, 192, 0, .15);  color: #a67c00; }
.kpi-icon.is-bad   { background-color: rgba(248, 40, 90, .1);   color: #d81a48; }

/* Progress ring used for occupancy / collection rate */
.ring {
    position: relative;
    height: 96px;
    width: 96px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.ring-inner {
    position: absolute;
    inset: 11px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--surface);
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* Plan / quota panel */
.plan-panel {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%);
    color: #fff;
    border: none;
}

.plan-panel .box-title,
.plan-panel .kpi-label { color: rgba(255, 255, 255, .8); }

.plan-panel .quota-bar {
    height: 8px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .22);
    overflow: hidden;
}

.plan-panel .quota-fill {
    height: 100%;
    border-radius: 999px;
    background-color: #ffffff;
}

/* ---------- Lists ----------------------------------------------------- */

.stack-list { margin: 0; padding: 0; list-style: none; }

.stack-list > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
}

.stack-list > li:first-child { border-top: none; }

.stack-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.stack-meta  { font-size: 12px; color: var(--ink-soft); }

.empty-state {
    padding: 34px 20px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
}

.empty-state svg { height: 26px; width: 26px; opacity: .45; margin-bottom: 10px; }

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

.form-label { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }

.form-control, .form-select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .55rem .8rem;
    color: var(--ink);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(22, 143, 200, .15);
}

.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad); }
.invalid-feedback { font-size: 12px; }
.form-text { color: var(--ink-soft); font-size: 12px; }

.input-group-text { background-color: var(--brand-tint); border-color: var(--line); color: var(--brand-darker); }

/* Select2 to match Bootstrap controls */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 1.1rem + 2px);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + 1.1rem);
    color: var(--ink);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 1.1rem);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand);
}

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

.table > :not(caption) > * > * { padding: .75rem .9rem; }

.table thead th {
    background-color: #f7fafc;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table tbody td { border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-hover tbody tr:hover { background-color: var(--brand-tint); }

/* DataTables */
.dataTables_wrapper { font-size: 13px; }
.dataTables_filter input, .dataTables_length select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .35rem .7rem;
    outline: none;
}
.dataTables_filter input:focus { border-color: var(--brand); }
.dataTables_info { color: var(--ink-soft); font-size: 12px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
    border-radius: 6px;
}
.dataTables_scrollBody { -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
    .dataTables_length, .dataTables_filter,
    .dataTables_info, .dataTables_paginate {
        float: none !important;
        text-align: left !important;
        margin-bottom: .5rem;
    }
    .dataTables_filter label { display: block; }
    .dataTables_filter input { width: 100%; margin-left: 0; margin-top: .25rem; }
}

/* ---------- Badges ---------------------------------------------------- */

.badge { font-weight: 600; letter-spacing: .01em; padding: .38em .7em; border-radius: 999px; }
.badge-primary-light { background-color: var(--brand-tint); color: var(--brand-darker); }
.badge-success-light { background-color: rgba(23, 198, 83, .14); color: #0f9c3f; }
.badge-warning-light { background-color: rgba(246, 192, 0, .18); color: #a67c00; }
.badge-danger-light  { background-color: rgba(248, 40, 90, .12); color: #d81a48; }
.badge-muted         { background-color: #eef2f5; color: var(--ink-soft); }

/* ---------- Alerts ---------------------------------------------------- */

.alert { display: flex; align-items: flex-start; gap: 12px; border-radius: 10px; border: 1px solid transparent; }
.alert .alert-icon { height: 18px; width: 18px; flex: 0 0 auto; margin-top: 2px; }
.alert-success { background-color: rgba(23, 198, 83, .1);  border-color: rgba(23, 198, 83, .28);  color: #0b7a30; }
.alert-warning { background-color: rgba(246, 192, 0, .12); border-color: rgba(246, 192, 0, .35);  color: #8a6800; }
.alert-danger  { background-color: rgba(248, 40, 90, .08); border-color: rgba(248, 40, 90, .28);  color: #c01840; }
.alert-info    { background-color: var(--brand-tint);      border-color: var(--brand-tint-strong); color: var(--brand-darker); }
.alert .btn-close { margin-left: auto; }

/* ---------- Auth screens ---------------------------------------------- */

.auth-page {
    background: linear-gradient(150deg, var(--brand) 0%, var(--brand-darker) 100%);
    min-height: 100vh;
}

.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo img { max-height: 46px; width: auto; }
.auth-page .rounded10 { border-radius: 14px; }
.auth-page .content-top-agile h2 { font-size: 22px; font-weight: 700; }
.auth-page a { color: var(--brand); }
.auth-page .text-white-link { color: #fff; text-decoration: underline; }

/* ---------- Tenant portal --------------------------------------------- */

.portal-header .navbar {
    background-color: var(--brand);
    padding: 0 12px;
    min-height: 64px;
}

.portal-brand img { max-height: 34px; width: auto; }

.portal-toggle {
    background: rgba(255, 255, 255, .15);
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
}

.portal-nav .nav-link {
    color: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
}

.portal-nav .nav-link svg { height: 17px; width: 17px; }
.portal-nav .nav-link:hover { background-color: rgba(255, 255, 255, .12); color: #fff; }
.portal-nav .nav-link.active { background-color: #fff; color: var(--brand-darker); font-weight: 600; }
.portal-account { color: #fff; padding: 10px 0; }
.portal-account .avatar-initials { background-color: rgba(255, 255, 255, .2); color: #fff; }
.portal-content { margin-left: 0 !important; padding-top: 20px; }
.layout-top-nav .main-footer { margin-left: 0; }

/* ---------- Receipt / print ------------------------------------------- */

.receipt-sheet {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 32px;
    max-width: 760px;
    margin: 0 auto;
}

@media print {
    .main-header, .main-sidebar, .main-footer,
    .content-header, .no-print, .alert { display: none !important; }
    .content-wrapper { margin: 0 !important; padding: 0 !important; }
    .receipt-sheet { border: none; box-shadow: none; max-width: none; padding: 0; }
    body { background: #fff; }
}

/* ---------- Accessibility & motion ------------------------------------ */

a:focus-visible,
button:focus-visible,
.form-control:focus-visible,
.sidebar-menu > li > a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- Utility shims ---------------------------------------------
   The template predates a few utilities the app markup relies on.
------------------------------------------------------------------------ */

.min-w-0 { min-width: 0; }
.fs-32   { font-size: 32px; }
.gap-2   { gap: .5rem; }
.gap-3   { gap: 1rem; }

.bg-brand.text-brand,
.btn.bg-white.text-brand { color: var(--brand) !important; background-color: #fff !important; }

/* ---------- Property cards -------------------------------------------- */

.property-card { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.property-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px -14px rgba(22, 143, 200, .5);
}
.property-card svg { height: 14px; width: 14px; vertical-align: -2px; margin-right: 4px; }

/* ---------- Import steps ---------------------------------------------- */

.import-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }

.import-steps > li {
    position: relative;
    padding-left: 38px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--ink);
}

.import-steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -1px;
    display: grid;
    place-items: center;
    height: 25px;
    width: 25px;
    border-radius: 50%;
    background-color: var(--brand-tint);
    color: var(--brand-darker);
    font-weight: 700;
    font-size: 12px;
}

.import-steps svg { height: 15px; width: 15px; vertical-align: -3px; }

/* ---------- Business card editor -------------------------------------- */

.theme-picker { margin-top: 4px; }

.theme-swatch { cursor: pointer; display: inline-block; }
.theme-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }

.theme-swatch > span:first-of-type {
    display: block;
    height: 40px;
    width: 64px;
    border-radius: 9px;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px var(--line);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.theme-swatch input:checked + span {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--brand);
}

.theme-swatch input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.bcard {
    aspect-ratio: 1.7 / 1;
    border-radius: 14px;
    padding: 22px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 14px 30px -14px rgba(28, 43, 54, .45);
    overflow: hidden;
}

.bcard-name    { font-size: 20px; font-weight: 800; line-height: 1.15; }
.bcard-title   { font-size: 13px; opacity: .92; }
.bcard-company { font-size: 13px; font-weight: 600; opacity: .96; }
.bcard-contact { font-size: 11px; opacity: .92; line-height: 1.65; }
.bcard-tagline { font-style: italic; opacity: .8; padding-top: 4px; }

/* ---------- Receipt ---------------------------------------------------- */

.receipt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%);
    color: #fff;
    margin: -32px -32px 0;
    padding: 26px 32px;
    border-radius: 12px 12px 0 0;
}

.receipt-title { font-size: 20px; font-weight: 700; margin: 0 0 2px; color: #fff; }

.receipt-amount {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
}

.receipt-meta { padding-top: 24px; margin: 0; }
.receipt-meta dt { margin-bottom: 3px; }

.receipt-foot {
    margin: 24px -32px -32px;
    padding: 14px 32px;
    background-color: #fbfdfe;
    border-top: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-soft);
}

@media print {
    .receipt-head { margin: 0; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .receipt-foot { margin: 24px 0 0; }
}

/* ---------- Responsive ------------------------------------------------- */

@media (max-width: 767px) {
    .content-header .page-title { font-size: 18px; }
    .kpi-value { font-size: 20px; }
    .receipt-sheet { padding: 20px; }
    .receipt-head { margin: -20px -20px 0; padding: 20px; }
    .receipt-foot { margin: 20px -20px -20px; padding: 12px 20px; }
}
