/* ==========================================================================
   Legal Scheduler — YAY Group
   Warna mengikuti logo Legal: navy + emas, latar kertas hangat.
   ========================================================================== */

:root {
    --navy: #1a2e66;
    --navy-dark: #12224d;
    --navy-soft: #eef1f8;
    --gold: #b8862b;
    --gold-bright: #d6a540;
    --gold-soft: #f7efdd;
    --ink: #1c2233;
    --muted: #6b7080;
    --line: #e4e1d8;
    --line-strong: #d3cfc3;
    --paper: #f6f5f1;
    --surface: #ffffff;
    --success: #1f7a55;
    --success-soft: #e5f2eb;
    --warning: #8f6200;
    --warning-soft: #fbf1d9;
    --danger: #b0303a;
    --danger-soft: #f9e8e8;
    --radius: 10px;
    --radius-sm: 7px;
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    /* Nama lama tetap dipakai beberapa halaman; diarahkan ke palet baru. */
    --yay-coral: var(--navy);
    --yay-coral-dark: var(--navy-dark);
    --yay-coral-soft: var(--navy-soft);
    --yay-yellow: var(--gold-bright);
    --yay-yellow-soft: var(--gold-soft);
    --yay-mint: var(--success);
    --yay-mint-soft: var(--success-soft);
    --yay-navy: var(--navy);
    --yay-ink: var(--ink);
    --yay-muted: var(--muted);
    --yay-border: var(--line);
    --yay-bg: var(--paper);
    --yay-white: var(--surface);

    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-link-color: var(--navy);
    --bs-link-color-rgb: 26, 46, 102;
    --bs-link-hover-color: var(--navy-dark);
    --bs-primary: var(--navy);
    --bs-primary-rgb: 26, 46, 102;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: .95rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .h3, .h4, .h5 {
    color: var(--ink);
}

h1, .h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: -.01em;
}

.fw-bold {
    font-weight: 600 !important;
}

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

.app-shell {
    width: min(100%, 1440px);
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Komponen Bootstrap
   -------------------------------------------------------------------------- */

.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: none !important;
}

.card-footer {
    border-color: var(--line) !important;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: var(--navy);
    --bs-btn-border-color: var(--navy);
    --bs-btn-hover-bg: var(--navy-dark);
    --bs-btn-hover-border-color: var(--navy-dark);
    --bs-btn-active-bg: var(--navy-dark);
    --bs-btn-active-border-color: var(--navy-dark);
    --bs-btn-disabled-bg: var(--navy);
    --bs-btn-disabled-border-color: var(--navy);
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-light {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: #efede6;
    --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: #e8e5dc;
    --bs-btn-active-border-color: var(--line-strong);
}

.btn-outline-primary {
    --bs-btn-color: var(--navy);
    --bs-btn-border-color: #c5cde0;
    --bs-btn-hover-bg: var(--navy);
    --bs-btn-hover-border-color: var(--navy);
    --bs-btn-active-bg: var(--navy-dark);
    --bs-btn-active-border-color: var(--navy-dark);
}

.btn-outline-danger {
    --bs-btn-color: var(--danger);
    --bs-btn-border-color: #e3bfc1;
    --bs-btn-hover-bg: var(--danger);
    --bs-btn-hover-border-color: var(--danger);
}

.btn-success {
    --bs-btn-bg: var(--success);
    --bs-btn-border-color: var(--success);
    --bs-btn-hover-bg: #186446;
    --bs-btn-hover-border-color: #186446;
}

.form-control,
.form-select {
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 46, 102, .12);
}

.form-check-input:checked {
    border-color: var(--navy);
    background-color: var(--navy);
}

.form-label {
    color: #3a3f4d;
    font-weight: 500;
}

.input-group-text {
    border-color: var(--line-strong);
    background: #f1efe9;
    color: var(--muted);
}

.table {
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: #faf9f6;
}

.badge {
    border-radius: 5px;
    font-weight: 600;
}

.text-bg-success { background-color: var(--success-soft) !important; color: var(--success) !important; }
.text-bg-warning { background-color: var(--warning-soft) !important; color: var(--warning) !important; }
.text-bg-secondary { background-color: #ecebe6 !important; color: #5c606c !important; }
.text-bg-danger { background-color: var(--danger-soft) !important; color: var(--danger) !important; }
.text-bg-primary { background-color: var(--navy-soft) !important; color: var(--navy) !important; }
.text-bg-info { background-color: #e7eef6 !important; color: #2b5680 !important; }

.alert {
    border-radius: var(--radius-sm);
}

.app-alert {
    border-width: 1px;
}

.modal-content {
    border-radius: var(--radius);
}

.dropdown-menu {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(28, 34, 51, .08) !important;
}

.section-kicker {
    color: var(--gold);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

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

.page-description {
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Navigasi
   -------------------------------------------------------------------------- */

.app-navbar {
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink) !important;
}

.app-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.app-brand-copy strong {
    color: var(--navy);
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
}

.app-brand-copy small {
    margin-top: .2rem;
    color: var(--gold);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.app-navbar .nav-link {
    position: relative;
    padding: 1.3rem .85rem !important;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
}

.app-navbar .nav-link:hover {
    color: var(--ink);
}

.app-navbar .nav-link.active {
    color: var(--navy);
    font-weight: 600;
}

.app-navbar .nav-link.active::after {
    position: absolute;
    right: .85rem;
    bottom: -1px;
    left: .85rem;
    height: 2px;
    background: var(--gold-bright);
    content: "";
}

.app-navbar .dropdown-menu {
    padding: .35rem;
}

.app-navbar .dropdown-item {
    padding: .5rem .7rem;
    border-radius: 5px;
    color: #3a3f4d;
    font-size: .88rem;
}

.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    background: var(--navy-soft);
    color: var(--navy);
}

.app-user-panel {
    padding-left: 1rem;
    border-left: 1px solid var(--line);
}

.app-user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
}

.app-user-copy {
    line-height: 1.15;
}

.app-user-copy strong,
.app-user-copy small {
    display: block;
}

.app-user-copy strong {
    max-width: 170px;
    overflow: hidden;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-copy small {
    color: var(--muted);
    font-size: .74rem;
}

.app-logout-button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
}

.app-logout-button:hover {
    border-color: var(--line-strong);
    background: var(--paper);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Dashboard: salam, ringkasan, tab jenis
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-head-date {
    margin: 0 0 .2rem;
    color: var(--muted);
    font-size: .85rem;
}

.page-head-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 700;
}

.page-head-actions {
    display: flex;
    gap: .5rem;
}

.overview {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    margin-bottom: 1.75rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.overview-total,
.overview-item {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.35rem;
}

.overview-total {
    background: var(--navy);
    color: #fff;
}

.overview-item {
    position: relative;
    border-left: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: background-color .15s ease;
}

.overview-item:hover {
    background: #faf9f6;
    color: var(--ink);
}

.overview-item.is-selected {
    background: var(--gold-soft);
}

.overview-item.is-selected::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--gold-bright);
    content: "";
}

.overview-label {
    font-size: .8rem;
    font-weight: 500;
}

.overview-total .overview-label,
.overview-total .overview-note {
    color: rgba(255, 255, 255, .72);
}

.overview-item .overview-label,
.overview-item .overview-note {
    color: var(--muted);
}

.overview-number {
    margin: .15rem 0 .1rem;
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.overview-total .overview-number {
    color: var(--gold-bright);
}

.overview-item.is-danger .overview-number { color: var(--danger); }
.overview-item.is-warning .overview-number { color: var(--warning); }

.overview-note {
    font-size: .78rem;
}

.type-tabs {
    display: flex;
    gap: .25rem;
    padding: 0 1.25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.type-tab {
    position: relative;
    flex: 0 0 auto;
    padding: .9rem .75rem;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.type-tab span {
    margin-left: .3rem;
    padding: .1rem .45rem;
    border-radius: 99px;
    background: #efede6;
    color: var(--muted);
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
}

.type-tab:hover {
    color: var(--ink);
}

.type-tab.is-active {
    color: var(--navy);
    font-weight: 600;
}

.type-tab.is-active span {
    background: var(--navy);
    color: #fff;
}

.type-tab.is-active::after {
    position: absolute;
    right: .75rem;
    bottom: -1px;
    left: .75rem;
    height: 2px;
    background: var(--navy);
    content: "";
}

/* --------------------------------------------------------------------------
   Dashboard: tabel jadwal
   -------------------------------------------------------------------------- */

.dashboard-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.dashboard-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem .5rem;
}

.dashboard-panel-header .section-kicker {
    display: none;
}

.dashboard-panel-header h2 {
    margin: 0 0 .15rem;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
}

.dashboard-panel-header p {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

.clear-filter-link {
    color: var(--danger);
    font-size: .84rem;
    font-weight: 500;
    text-decoration: none;
}

.brand-filter-form {
    padding: 1rem 1.25rem 1.25rem;
}

.brand-filter-form .form-label {
    margin-bottom: .3rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
}

.brand-filter-form .form-control,
.brand-filter-form .form-select {
    min-height: 40px;
    font-size: .9rem;
}

.filter-input-group {
    position: relative;
}

.filter-input-group > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: .8rem;
    color: #9a9da7;
    transform: translateY(-50%);
}

.filter-input-group .form-control {
    padding-right: 2.4rem;
    padding-left: 2.3rem;
}

.filter-input-group .spinner-border {
    position: absolute;
    top: calc(50% - .5rem);
    right: .9rem;
    color: var(--navy);
}

.dashboard-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--line);
}

.dashboard-table {
    min-width: 1100px;
    --bs-table-hover-bg: #faf9f6;
}

.dashboard-table thead th {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #faf9f6;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-table tbody td {
    padding: 1rem;
    border-color: var(--line);
    color: var(--ink);
    vertical-align: top;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.schedule-type-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-type-pill i {
    display: none;
}

.schedule-type-pill::before {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--type-color, #9a9da7);
    content: "";
}

.type-lease { --type-color: var(--navy); }
.type-meeting { --type-color: var(--gold-bright); }
.type-permit { --type-color: var(--success); }
.type-insurance { --type-color: #5b7fb5; }
.type-default { --type-color: #9a9da7; }

.schedule-unit {
    margin-top: .35rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.schedule-category {
    display: flex;
    align-items: center;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .78rem;
}

.schedule-category span {
    width: 7px;
    height: 7px;
    margin-right: .35rem;
    border-radius: 50%;
}

.schedule-title {
    margin-bottom: .2rem;
    color: var(--ink);
    font-size: .95rem;
    font-weight: 600;
}

.schedule-email {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--muted);
    font-size: .8rem;
}

.schedule-subtitle {
    margin-top: .25rem;
    color: var(--muted);
    font-size: .8rem;
}

.schedule-date {
    min-width: 140px;
    font-variant-numeric: tabular-nums;
}

.date-range span,
.date-range strong {
    display: block;
    font-size: .86rem;
}

.date-range span {
    color: var(--muted);
}

.date-range small {
    display: none;
}

.date-range strong,
.schedule-date > strong {
    color: var(--ink);
    font-weight: 600;
}

.date-label {
    display: block;
    color: var(--muted);
    font-size: .74rem;
}

.due-hint {
    display: inline-block;
    margin-top: .3rem;
    color: var(--muted);
    font-size: .76rem;
}

.due-hint.is-late {
    color: var(--danger);
    font-weight: 600;
}

.notes-cell {
    min-width: 200px;
    max-width: 320px;
    color: var(--muted) !important;
    font-size: .85rem;
    white-space: normal;
}

.attachment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.attachment-button {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .5rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    font-size: .78rem;
    text-decoration: none;
}

.attachment-button:hover {
    border-color: var(--line-strong);
    background: var(--paper);
    color: var(--ink);
}

.no-attachment {
    color: #a7a9b2;
}

.schedule-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .55rem;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.schedule-status i {
    font-size: .4rem;
}

.status-active { background: var(--success-soft); color: var(--success); }
.status-completed { background: #ecebe6; color: #5c606c; }
.status-cancelled { background: var(--danger-soft); color: var(--danger); }
.status-default { background: #ecebe6; color: #5c606c; }

.action-heading,
.action-cell {
    position: sticky;
    right: 0;
    z-index: 3;
    background: var(--surface);
}

.action-heading {
    z-index: 4;
    background: #faf9f6 !important;
}

.action-cell {
    vertical-align: middle !important;
}

.action-group {
    display: inline-flex;
    gap: .25rem;
}

.action-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: .85rem;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.action-view:hover,
.action-edit:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.action-complete {
    color: var(--success);
}

.action-complete:hover {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.action-delete {
    color: var(--danger);
}

.action-delete:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.schedule-row {
    scroll-margin-top: 90px;
    transition: background-color .35s ease;
}

.schedule-row-highlight td {
    background: var(--gold-soft) !important;
}

.dashboard-empty-state {
    padding: 3.5rem 1rem;
    text-align: center;
}

.dashboard-empty-state > span {
    display: block;
    margin-bottom: .5rem;
    color: #b3b5bd;
    font-size: 2rem;
}

.dashboard-empty-state h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.dashboard-empty-state p {
    color: var(--muted);
}

.pagination {
    --bs-pagination-color: var(--ink);
    --bs-pagination-border-color: var(--line);
    --bs-pagination-hover-bg: var(--paper);
    --bs-pagination-active-bg: var(--navy);
    --bs-pagination-active-border-color: var(--navy);
}

/* --------------------------------------------------------------------------
   Form jadwal
   -------------------------------------------------------------------------- */

.type-option {
    cursor: pointer;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius) !important;
    transition: border-color .15s ease, background-color .15s ease;
}

.type-option:hover {
    border-color: var(--navy) !important;
}

.btn-check:checked + .type-option {
    border-color: var(--navy) !important;
    background: var(--navy-soft);
    box-shadow: inset 0 0 0 1px var(--navy) !important;
}

.type-option-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .3rem;
    color: var(--ink);
    font-weight: 600;
}

.type-option-title i {
    color: var(--gold);
}

.schedule-form .form-section {
    padding: 1.35rem 0;
    border-bottom: 1px solid var(--line);
}

.schedule-form .form-section:first-child {
    padding-top: .25rem;
}

.schedule-form #type-dependent > :last-child,
.schedule-form #type-dependent > div:last-child > .form-section:last-child {
    padding-bottom: .25rem;
    border-bottom: 0;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1rem;
}

.form-section-head h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.form-section-head p {
    margin: .1rem 0 0;
    color: var(--muted);
    font-size: .85rem;
}

.form-section-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--gold-soft);
    color: var(--gold);
    font-size: 1rem;
}

.schedule-form .form-label {
    margin-bottom: .3rem;
    font-size: .86rem;
}

.section-title {
    padding: .6rem .9rem;
    border-left: 3px solid var(--gold-bright);
    background: var(--gold-soft);
    color: var(--ink);
    font-weight: 600;
}

.current-file-box {
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    word-break: break-word;
}

.payment-grid {
    display: grid;
    gap: .5rem;
}

.payment-grid-head,
.payment-grid-row {
    grid-template-columns: 130px repeat(4, minmax(0, 1fr));
    gap: .75rem;
    align-items: center;
}

.payment-grid-head {
    padding: 0 .75rem;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.payment-grid-row {
    display: grid;
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfaf7;
}

.payment-stage {
    font-weight: 600;
}

.reminder-hint {
    display: flex;
    align-items: center;
    height: 100%;
    min-height: 38px;
    padding: .5rem .8rem;
    border-left: 3px solid var(--gold-bright);
    background: var(--gold-soft);
    color: #6f5419;
    font-size: .85rem;
}

.reminder-hint:empty {
    display: none;
}

.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface) !important;
}

.completion-option {
    cursor: pointer;
    border-color: var(--line-strong) !important;
}

.completion-option:has(input:checked) {
    border-color: var(--navy) !important;
    background: var(--navy-soft);
}

/* --------------------------------------------------------------------------
   Detail, admin, kalender
   -------------------------------------------------------------------------- */

.detail-label {
    margin-bottom: .2rem;
    color: var(--muted);
    font-size: .76rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.detail-grid > div {
    min-height: 54px;
}

.detail-photo-preview {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.detail-photo-preview img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.detail-payment-table th,
.detail-payment-table td {
    white-space: nowrap;
}

.feature-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    font-size: 1.5rem;
}

.permission-table th,
.permission-table td {
    min-width: 170px;
}

.permission-table th:first-child,
.permission-table td:first-child {
    min-width: 260px;
}

.permission-yes,
.permission-no,
.permission-limited {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .86rem;
    font-weight: 500;
}

.permission-yes { color: var(--success); }
.permission-no { color: var(--danger); }
.permission-limited { color: var(--warning); }

.category-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: .45rem;
    border-radius: 50%;
    vertical-align: middle;
}

.calendar-card {
    overflow: hidden;
}

.legal-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.calendar-weekday {
    padding: .65rem;
    background: #faf9f6;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 130px;
    padding: .6rem;
    background: var(--surface);
}

.calendar-day.other-month {
    background: #f8f7f3;
    color: #b0b2ba;
}

.calendar-day.today {
    box-shadow: inset 0 3px 0 var(--gold-bright);
}

.calendar-day.today .calendar-day-number {
    color: var(--navy);
}

.calendar-day-number {
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.calendar-events {
    display: grid;
    gap: .3rem;
}

.calendar-event {
    display: block;
    overflow: hidden;
    padding: .35rem .5rem;
    border-left: 3px solid var(--event-color);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
}

.calendar-event:hover {
    background: var(--navy-soft);
    color: var(--navy);
}

.calendar-event span,
.calendar-event strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event span {
    color: var(--muted);
    font-size: .64rem;
}

.calendar-event strong {
    margin-top: .1rem;
    font-size: .74rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Proyeksi sewa
   -------------------------------------------------------------------------- */

.projection-stat {
    height: 100%;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-top: 3px solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
}

.projection-stat small {
    display: block;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.projection-stat strong {
    display: block;
    margin: .25rem 0 .1rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.projection-stat span {
    color: var(--muted);
    font-size: .82rem;
}

.projection-stat.is-primary { border-top-color: var(--gold-bright); background: var(--navy); }
.projection-stat.is-primary small,
.projection-stat.is-primary span { color: rgba(255, 255, 255, .72); }
.projection-stat.is-primary strong { color: var(--gold-bright); font-size: 1.45rem; }
.projection-stat.is-warning { border-top-color: var(--gold-bright); }
.projection-stat.is-warning strong { color: var(--warning); }
.projection-stat.is-muted { border-top-color: #b8bac2; }

.projection-table thead th {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.projection-table tbody td {
    font-variant-numeric: tabular-nums;
}

.projection-table tfoot th {
    background: var(--gold-soft);
}

.projection-month.is-empty {
    opacity: .45;
}

.projection-bar {
    height: 5px;
    margin-top: .3rem;
    overflow: hidden;
    border-radius: 99px;
    background: #ecebe6;
}

.projection-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--navy);
}

/* --------------------------------------------------------------------------
   Responsif
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .app-navbar .nav-link {
        padding: .6rem 0 !important;
    }

    .app-navbar .nav-link.active::after {
        display: none;
    }

    .app-user-panel {
        padding: 1rem 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-item:nth-child(3) {
        border-left: 0;
    }

    .overview-item:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 991.98px) {
    .legal-calendar {
        display: block;
        background: transparent;
    }

    .calendar-weekday,
    .calendar-day.other-month {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        margin-bottom: .5rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
    }

    .payment-grid-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-stage {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    main.app-shell {
        padding-top: 1.1rem !important;
    }

    .page-head-actions {
        width: 100%;
    }

    .page-head-actions .btn {
        flex: 1;
    }

    .overview-number {
        font-size: 1.7rem;
    }

    .dashboard-panel-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem 1rem .25rem;
    }

    .brand-filter-form {
        padding: 1rem;
    }

    .type-tabs {
        padding: 0 .5rem;
    }

    .dashboard-table-wrap {
        overflow: visible;
        border-top: 0;
    }

    .dashboard-table {
        display: block;
        min-width: 0;
        padding: 0 1rem 1rem;
    }

    .dashboard-table thead {
        display: none;
    }

    .dashboard-table tbody,
    .dashboard-table tr,
    .dashboard-table td {
        display: block;
        width: 100%;
    }

    .dashboard-table tbody tr {
        overflow: hidden;
        margin-bottom: .75rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
    }

    .dashboard-table tbody td {
        position: relative;
        min-height: 48px;
        padding: .7rem 1rem .7rem 40%;
        border-bottom: 1px solid #efede6;
        text-align: left !important;
    }

    .dashboard-table tbody td::before {
        position: absolute;
        top: .8rem;
        left: 1rem;
        width: 34%;
        color: var(--muted);
        content: attr(data-label);
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .dashboard-table tbody td:last-child {
        border-bottom: 0;
    }

    .notes-cell {
        min-width: 0;
        max-width: none;
    }

    .action-heading,
    .action-cell {
        position: relative;
        right: auto;
    }

    .action-group {
        justify-content: flex-start;
    }
}

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

    .overview-total {
        grid-column: 1 / -1;
    }

    .overview-item:nth-child(2),
    .overview-item:nth-child(4) {
        border-left: 0;
    }

    .overview-item:nth-child(3) {
        border-left: 1px solid var(--line);
    }

    .overview-item:nth-child(n + 2) {
        border-top: 1px solid var(--line);
    }

    .payment-grid-row {
        grid-template-columns: 1fr;
    }
}
