/* =====================================================================
   DolilGhor (দলিলঘর) theme
   Loaded after bootstrap + style.css. Holds design tokens, the app
   shell (sidebar / topbar / footer), and global component restyles so
   every existing page picks up the new look without per-page changes.
   ===================================================================== */

:root {
    /* brand */
    --dg-primary: #0E5A47;
    --dg-primary-600: #0B4A3A;
    --dg-primary-700: #083A2E;
    --dg-primary-100: #D4E8E0;
    --dg-primary-50: #EAF4F0;
    --dg-accent: #D9963A;
    --dg-accent-soft: #F1CF8C;

    /* neutrals (warm "paper") */
    --dg-bg: #F4F5F0;
    --dg-surface: #FFFFFF;
    --dg-surface-2: #F8F9F6;
    --dg-border: #E2E5DE;
    --dg-border-strong: #CDD2C8;
    --dg-ink: #1A2420;
    --dg-ink-2: #3B4742;
    --dg-muted: #66736D;

    /* sidebar */
    --dg-side-bg: #0F2C25;
    --dg-side-bg-2: #14382F;
    --dg-side-ink: #C9D8D2;
    --dg-side-ink-strong: #FFFFFF;
    --dg-side-muted: #7F9A90;

    /* status */
    --dg-danger: #B42318;
    --dg-danger-50: #FDECEA;
    --dg-info: #1F6F8B;
    --dg-info-50: #E6F2F6;
    --dg-warning: #B7791F;

    --dg-radius: 12px;
    --dg-radius-sm: 8px;
    --dg-shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 1px 3px rgba(16, 32, 26, .06);
    --dg-shadow-lg: 0 12px 32px -12px rgba(16, 32, 26, .22);
    --dg-ring: 0 0 0 3px rgba(14, 90, 71, .18);

    --dg-sidebar-w: 280px;
    --dg-topbar-h: 64px;

    --dg-font: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --dg-font-brand: 'Noto Serif Bengali', 'Hind Siliguri', serif;
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
* {
    font-family: var(--dg-font);
}

/* keep icon fonts intact after the global font override */
.fa, .fa-solid, .fas, .fa-regular, .far, .fa-brands, .fab {
    font-family: "Font Awesome 6 Free" !important;
}
.fa-brands, .fab {
    font-family: "Font Awesome 6 Brands" !important;
}

html, body {
    background: var(--dg-bg);
}

body.dg-body {
    color: var(--dg-ink);
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--dg-primary);
}
a:hover {
    color: var(--dg-primary-700);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--dg-ink);
    font-weight: 600;
    letter-spacing: -.005em;
}

::selection {
    background: var(--dg-primary-100);
}

/* ---------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------- */
.dg-shell {
    min-height: 100vh;
}

.dg-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--dg-sidebar-w);
    min-width: 0;
}

.dg-content {
    flex: 1;
    padding: 28px 32px 40px;
    min-width: 0;
}

.dg-messages {
    margin-bottom: 16px;
}
.dg-messages .alert {
    border-radius: var(--dg-radius-sm);
    margin-bottom: 8px;
}

/* sidebar */
.dg-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--dg-sidebar-w);
    background: var(--dg-side-bg);
    color: var(--dg-side-ink);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.dg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    min-height: var(--dg-topbar-h);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    text-decoration: none;
}
.dg-brand img {
    flex: none;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.dg-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.dg-wordmark {
    color: var(--dg-side-ink-strong);
    font-family: var(--dg-font-brand) !important;
    font-size: 22px;
    font-weight: 700;
}
.dg-tagline {
    color: var(--dg-side-muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.dg-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.dg-nav-link,
.dg-nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 2px;
    border: 0;
    border-radius: var(--dg-radius-sm);
    background: transparent;
    color: var(--dg-side-ink);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    transition: background-color .15s ease, color .15s ease;
}
.dg-nav-link:hover,
.dg-nav-toggle:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--dg-side-ink-strong);
}
.dg-nav-link:focus-visible,
.dg-nav-toggle:focus-visible,
.dg-subnav-link:focus-visible {
    outline: 2px solid var(--dg-accent-soft);
    outline-offset: -2px;
}
.dg-nav-link.active {
    background: var(--dg-side-bg-2);
    color: var(--dg-side-ink-strong);
}
.dg-nav-toggle.has-active {
    color: var(--dg-side-ink-strong);
}

.dg-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--dg-side-muted);
    flex: none;
}
.dg-nav-link.active .dg-nav-icon,
.dg-nav-toggle.has-active .dg-nav-icon {
    color: var(--dg-accent-soft);
}
.dg-nav-toggle span {
    flex: 1;
}
.dg-nav-caret {
    font-size: 11px;
    color: var(--dg-side-muted);
    transition: transform .2s ease;
}
.dg-nav-toggle:not(.collapsed) .dg-nav-caret {
    transform: rotate(90deg);
}

.dg-subnav {
    list-style: none;
    margin: 2px 0 8px 22px;
    padding: 0 0 0 12px;
    border-left: 1px solid rgba(255, 255, 255, .1);
}
.dg-subnav-link {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--dg-side-ink);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    opacity: .85;
}
.dg-subnav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--dg-side-ink-strong);
    opacity: 1;
}
.dg-subnav-link.active {
    background: rgba(241, 207, 140, .12);
    color: var(--dg-accent-soft);
    opacity: 1;
    font-weight: 600;
}

.dg-sidebar-backdrop {
    display: none;
}

/* topbar */
.dg-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--dg-topbar-h);
    padding: 0 32px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--dg-border);
}
.dg-topbar-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.dg-office {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--dg-ink-2);
    font-weight: 500;
}
.dg-office i {
    color: var(--dg-primary);
}
.dg-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--dg-primary-50);
    color: var(--dg-primary);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.dg-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--dg-border);
    border-radius: var(--dg-radius-sm);
    background: var(--dg-surface);
    color: var(--dg-ink-2);
}

.dg-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--dg-ink);
    font-weight: 500;
}
.dg-user:hover,
.dg-user[aria-expanded="true"] {
    background: var(--dg-surface-2);
    border-color: var(--dg-border);
}
.dg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dg-primary);
    color: #fff;
    font-weight: 600;
}
.dg-user-caret {
    font-size: 11px;
    color: var(--dg-muted);
}

.dg-dropdown {
    min-width: 230px;
    padding: 6px;
    border: 1px solid var(--dg-border);
    border-radius: var(--dg-radius);
    box-shadow: var(--dg-shadow-lg);
}
.dg-dropdown-header {
    padding: 8px 12px 4px;
}
.dg-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
}
.dg-dropdown .dropdown-item i {
    width: 16px;
    color: var(--dg-muted);
}
.dg-dropdown .dropdown-item.text-danger i {
    color: var(--dg-danger);
}

/* footer */
.dg-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 18px 32px;
    border-top: 1px solid var(--dg-border);
    color: var(--dg-muted);
    font-size: 13.5px;
}

/* ---------------------------------------------------------------------
   Cards (every page is a .card with a .card-header)
   --------------------------------------------------------------------- */
.card {
    background: var(--dg-surface);
    border: 1px solid var(--dg-border);
    border-radius: var(--dg-radius);
    box-shadow: var(--dg-shadow);
}

/* top-level page card: tame the legacy p-5 / my-5 utility spacing */
.dg-content > .card,
.dg-content > form > .card,
.dg-content > div > .card:first-child {
    margin-top: 0 !important;
    margin-bottom: 24px !important;
}
.dg-content > .card.p-5,
.dg-content > .card.p-md-5 {
    padding: 8px 24px 24px !important;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--dg-border);
    padding: 18px 20px;
}
.card-header:first-child {
    border-radius: var(--dg-radius) var(--dg-radius) 0 0;
}
.dg-content > .card.p-5 > .card-header,
.dg-content > .card.p-md-5 > .card-header {
    margin: 0 -24px 20px;
    padding: 18px 24px;
}
.card-header h1, .card-header h2, .card-header h3,
.card-header .h1, .card-header .h2, .card-header .h3,
.card-header .card-title {
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    border: 1px solid transparent;
    border-radius: var(--dg-radius-sm);
    padding: 9px 18px;
    font-weight: 600;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-sm {
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13.5px;
    text-transform: none;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}
.btn:focus,
.btn:focus-visible {
    box-shadow: var(--dg-ring) !important;
}

.btn-primary,
.btn-success {
    background: var(--dg-primary);
    border-color: var(--dg-primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active,
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active {
    background: var(--dg-primary-600) !important;
    border-color: var(--dg-primary-600) !important;
    color: #fff !important;
}

/* "back" and secondary actions were bright cyan; make them quiet outlines */
.btn-info,
.btn-secondary,
.btn-light {
    background: var(--dg-surface);
    border-color: var(--dg-border-strong);
    color: var(--dg-ink-2);
}
.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.show,
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active,
.btn-light:hover, .btn-light:focus, .btn-light:active {
    background: var(--dg-surface-2) !important;
    border-color: var(--dg-primary) !important;
    color: var(--dg-primary) !important;
}

/* legacy markup pairs btn-info with text-light/text-white; keep it readable on the new outline style */
.btn-info.text-light,
.btn-info.text-white,
.btn-secondary.text-light,
.btn-secondary.text-white {
    color: var(--dg-ink-2) !important;
}
.btn-info.text-light:hover, .btn-info.text-light:focus, .btn-info.text-light.show,
.btn-info.text-white:hover, .btn-info.text-white:focus, .btn-info.text-white.show {
    color: var(--dg-primary) !important;
}

.btn-warning {
    background: #FBF0DD;
    border-color: #F0D9AE;
    color: #7A4B0B;
}
.btn-warning:hover, .btn-warning:focus {
    background: #F6E3C0;
    border-color: #E9C98C;
    color: #6A4009;
}

.btn-danger {
    background: var(--dg-danger);
    border-color: var(--dg-danger);
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus {
    background: #931B12;
    border-color: #931B12;
    color: #fff;
}

.btn-outline-primary,
.btn-outline-success {
    border-color: var(--dg-primary);
    color: var(--dg-primary);
}
.btn-outline-primary:hover,
.btn-outline-success:hover {
    background: var(--dg-primary);
    border-color: var(--dg-primary);
    color: #fff;
}

.btn-link {
    color: var(--dg-primary);
}

/* legacy per-form accent buttons (#00c599 etc.) -> brand primary */
.stamp-duty button,
.fifty-three-h button,
.fifty-three-hh button,
.fifty-three-ff button,
.vat-fee .btn-vat-fee,
.btn-calculate-vat-fee,
.local-government-tax .btn-calculate-govt-tax,
.local-government-tax .btn-govt-tax,
.registration-fee .add-registration-fee,
#btn-calculate-registration-fee,
.registry .master-registry-button,
.detail-button,
.master-registry .registry-button .detail {
    background: var(--dg-primary);
    border-color: var(--dg-primary);
    color: #fff;
    font-size: 15px;
}
.stamp-duty button:hover, .stamp-duty button:focus,
.fifty-three-h button:hover, .fifty-three-h button:focus,
.fifty-three-hh button:hover, .fifty-three-hh button:focus,
.fifty-three-ff button:hover, .fifty-three-ff button:focus,
.vat-fee .btn-vat-fee:hover, .vat-fee .btn-vat-fee:focus,
.btn-calculate-vat-fee:hover, .btn-calculate-vat-fee:focus,
.local-government-tax .btn-calculate-govt-tax:hover, .local-government-tax .btn-calculate-govt-tax:focus,
.local-government-tax .btn-govt-tax:hover, .local-government-tax .btn-govt-tax:focus,
.registration-fee .add-registration-fee:hover,
#btn-calculate-registration-fee:hover, #btn-calculate-registration-fee:focus,
.registry .master-registry-button:hover,
.detail-button:hover,
.master-registry .registry-button .detail:hover {
    background: var(--dg-primary-600);
    border-color: var(--dg-primary-600);
    color: #fff;
}
/* don't paint close/dropdown/toggle buttons inside those forms */
.stamp-duty button.btn-close,
.fifty-three-h button.btn-close,
.fifty-three-hh button.btn-close,
.fifty-three-ff button.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
}

.edit-button,
.master-registry .registry-button .edit {
    background: var(--dg-surface);
    border-color: var(--dg-border-strong);
    color: var(--dg-ink-2);
}
.edit-button:hover,
.master-registry .registry-button .edit:hover {
    background: var(--dg-surface-2);
    border-color: var(--dg-primary);
    color: var(--dg-primary);
}

#document-summary-table .btn-document-summary-edit,
#schedule-table .btn-schedule-edit,
#registration-fee-type-details-table .btn-registration-fee-details-edit {
    background: var(--dg-info-50);
    color: var(--dg-info);
    border-color: transparent;
}
#document-summary-table .btn-document-summary-delete,
#schedule-table .btn-schedule-delete,
#registration-fee-type-details-table .btn-registration-fee-details-delete {
    background: var(--dg-danger-50);
    color: var(--dg-danger);
    border-color: transparent;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
label,
.form-label {
    color: var(--dg-ink-2);
    font-size: 14.5px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control,
.form-select,
input[type=text],
input[type=date],
input[type=number],
input[type=email],
input[type=password],
input[type=file],
textarea,
select {
    border: 1px solid var(--dg-border-strong);
    border-radius: var(--dg-radius-sm) !important;
    background-color: var(--dg-surface);
    color: var(--dg-ink);
    font-size: 15px;
    padding: 9px 14px !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-check-input {
    border-color: var(--dg-border-strong);
}
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--dg-primary) !important;
    box-shadow: var(--dg-ring) !important;
    outline: 0;
}
.form-control:disabled,
.form-control[readonly] {
    background-color: var(--dg-surface-2);
}
.form-check-input:checked {
    background-color: var(--dg-primary);
    border-color: var(--dg-primary);
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-selection {
    border: 1px solid var(--dg-border-strong) !important;
    border-radius: var(--dg-radius-sm) !important;
    min-height: 44px;
    padding: 6px 12px !important;
}
.select2-selection__arrow {
    height: 42px !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection {
    border-color: var(--dg-primary) !important;
    box-shadow: var(--dg-ring);
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--dg-primary);
}
.select2-dropdown {
    border-color: var(--dg-border-strong);
    border-radius: var(--dg-radius-sm);
}

.errorlist {
    margin: 4px 0 0;
    padding-left: 0;
    list-style: none;
}
.errorlist li,
label.error,
.error:not(input):not(select):not(textarea) {
    color: var(--dg-danger);
    font-size: 13.5px;
}
input.error,
select.error,
textarea.error {
    border-color: var(--dg-danger) !important;
}

/* ---------------------------------------------------------------------
   Tables & DataTables
   --------------------------------------------------------------------- */
.table {
    color: var(--dg-ink);
    border-color: var(--dg-border);
}
.table > thead th,
table.dataTable thead th,
table.dataTable thead td,
#document-summary-table th,
#schedule-table th,
#registration-fee-type-details-table th {
    background: var(--dg-surface-2);
    color: var(--dg-ink-2);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--dg-border-strong) !important;
    white-space: nowrap;
}
#document-summary-table td,
#schedule-table td,
#registration-fee-type-details-table td {
    background: var(--dg-surface);
    box-shadow: none;
}
.table > tbody > tr > td,
table.dataTable tbody td {
    border-color: var(--dg-border);
    vertical-align: middle;
}
table.dataTable tbody tr:hover > td {
    background-color: var(--dg-primary-50);
}
table.dataTable.no-footer {
    border-bottom-color: var(--dg-border);
}
table.dataTable tbody tr td.dataTables_empty {
    color: var(--dg-muted);
    padding: 28px 0;
    background: var(--dg-surface);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    color: var(--dg-muted);
    font-size: 14px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    color: var(--dg-ink-2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--dg-primary-50) !important;
    border-color: var(--dg-primary-100) !important;
    color: var(--dg-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--dg-primary) !important;
    border-color: var(--dg-primary) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--dg-border-strong) !important;
    background: transparent !important;
    border-color: transparent !important;
}
td.dtfc-fixed-right,
th.dtfc-fixed-right {
    background-color: var(--dg-surface-2) !important;
}

/* ---------------------------------------------------------------------
   Tabs, modals, dropdowns, alerts
   --------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 1px solid var(--dg-border);
    gap: 4px;
}
.nav-tabs .nav-link,
.master-registry-tab .nav-item .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--dg-muted);
    font-size: 15px;
    font-weight: 500;
    padding: 12px 16px;
    margin: 0;
}
.nav-tabs .nav-link:hover {
    color: var(--dg-ink);
    border-bottom-color: var(--dg-border-strong);
}
.nav-tabs .nav-link.active,
.master-registry-tab .nav-item .nav-link.active {
    background: transparent;
    color: var(--dg-primary);
    border-bottom-color: var(--dg-primary);
    font-size: 15px;
    font-weight: 600;
}
.master-registry-tab-content {
    background: var(--dg-surface);
    border: 1px solid var(--dg-border);
    border-top: 0;
    border-radius: 0 0 var(--dg-radius) var(--dg-radius);
}

.registry-details {
    background: var(--dg-surface);
    box-shadow: var(--dg-shadow);
}
.registry-details .card-header {
    background: transparent;
}

.modal-content {
    border: 0;
    border-radius: var(--dg-radius);
    box-shadow: var(--dg-shadow-lg);
}
.modal-header {
    border-bottom-color: var(--dg-border);
}
.modal-footer {
    border-top-color: var(--dg-border);
}
.modal-content .modal-footer .btn-secondary:hover {
    background: var(--dg-surface-2) !important;
}

.dropdown-menu {
    border-color: var(--dg-border);
    border-radius: var(--dg-radius-sm);
    box-shadow: var(--dg-shadow-lg);
}
.dropdown-item:active {
    background-color: var(--dg-primary);
}

.alert {
    border-radius: var(--dg-radius-sm);
}
.alert-success {
    background: var(--dg-primary-50);
    border-color: var(--dg-primary-100);
    color: var(--dg-primary-700);
}

/* legacy light-blue / tinted panels -> neutral surfaces */
.registry .card,
.stamp-duty .card,
.fifty-three-h .card,
.fifty-three-hh .card,
.registration-fee .card {
    background: var(--dg-surface);
    border-radius: var(--dg-radius);
}
.stamp-duty .card-header,
.registration-fee .card-header {
    background: transparent;
}

/* datepicker */
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.active {
    background: var(--dg-primary) !important;
}

/* ---------------------------------------------------------------------
   Home / dashboard
   --------------------------------------------------------------------- */
.dg-welcome {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    margin-bottom: 28px;
    border-radius: var(--dg-radius);
    background: linear-gradient(135deg, var(--dg-primary) 0%, var(--dg-primary-700) 100%);
    color: #fff;
}
.dg-welcome::after {
    /* faint ruled-paper texture, a nod to the register books */
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 28px);
    pointer-events: none;
}
.dg-welcome > * {
    position: relative;
    z-index: 1;
}
.dg-welcome-eyebrow {
    color: var(--dg-accent-soft);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.dg-welcome h1 {
    color: #fff;
    font-family: var(--dg-font-brand) !important;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 700;
    margin: 0 0 6px;
}
.dg-welcome p {
    color: rgba(255, 255, 255, .78);
    margin: 0;
}
.dg-welcome-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, .85);
}
.dg-welcome-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: var(--dg-ink-2);
    font-size: 16px;
    font-weight: 600;
}
.dg-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--dg-border);
}

.dg-quick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.dg-quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px dashed var(--dg-border-strong);
    border-radius: var(--dg-radius);
    background: var(--dg-surface);
    color: var(--dg-ink);
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.dg-quick-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--dg-primary-50);
    color: var(--dg-primary);
    flex: none;
}
.dg-quick-link:hover {
    border-style: solid;
    border-color: var(--dg-primary);
    background: var(--dg-primary-50);
    color: var(--dg-primary-700);
}

.dg-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.dg-tile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    min-height: 132px;
    border: 1px solid var(--dg-border);
    border-radius: var(--dg-radius);
    background: var(--dg-surface);
    box-shadow: var(--dg-shadow);
    color: var(--dg-ink);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dg-tile:hover {
    transform: translateY(-2px);
    border-color: var(--dg-primary-100);
    box-shadow: var(--dg-shadow-lg);
    color: var(--dg-ink);
}
.dg-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--dg-primary-50);
    color: var(--dg-primary);
    font-size: 18px;
}
.dg-tile-icon.is-accent {
    background: #FBF0DD;
    color: #9A5B12;
}
.dg-tile-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}
.dg-tile-cta {
    margin-top: auto;
    color: var(--dg-primary);
    font-size: 14px;
    font-weight: 600;
}
.dg-tile-cta i {
    transition: transform .15s ease;
}
.dg-tile:hover .dg-tile-cta i {
    transform: translateX(3px);
}

/* ---------------------------------------------------------------------
   Auth pages (login / signup)
   --------------------------------------------------------------------- */
.dg-auth {
    min-height: 100vh;
}
.dg-auth > .dg-messages {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    min-width: min(480px, 92vw);
}

.dg-auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}
.dg-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background: var(--dg-side-bg);
    color: var(--dg-side-ink);
}
.dg-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 500px at 110% 110%, rgba(217, 150, 58, .18), transparent 60%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 32px);
    pointer-events: none;
}
.dg-auth-brand > * {
    position: relative;
}
.dg-auth-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dg-auth-logo .dg-wordmark {
    font-size: 28px;
}
.dg-auth-headline {
    max-width: 30rem;
}
.dg-auth-headline h1 {
    color: #fff;
    font-family: var(--dg-font-brand) !important;
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 14px;
}
.dg-auth-headline p {
    color: var(--dg-side-ink);
    font-size: 17px;
    margin: 0;
}
.dg-auth-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-auth-points li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    font-size: 14px;
}
.dg-auth-points i {
    color: var(--dg-accent-soft);
}

.dg-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--dg-bg);
}
.dg-auth-card {
    width: 100%;
    max-width: 420px;
}
.dg-auth-card .dg-auth-mobile-logo {
    display: none;
}
.dg-auth-card h2 {
    font-size: 1.75rem;
    margin-bottom: 6px;
}
.dg-auth-sub {
    color: var(--dg-muted);
    margin-bottom: 28px;
}
.dg-auth-card .form-field {
    margin-bottom: 16px;
}
.dg-auth-card input[type=text],
.dg-auth-card input[type=email],
.dg-auth-card input[type=password],
.dg-auth-card select {
    display: block;
    width: 100%;
    padding: 11px 14px !important;
}
.dg-auth-card .btn-primary {
    width: 100%;
    padding: 12px 18px;
    font-size: 16px;
}
.dg-auth-foot {
    margin-top: 20px;
    color: var(--dg-muted);
    font-size: 14.5px;
    text-align: center;
}
.dg-auth-card .non-field-errors,
.dg-auth-card .alert {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .dg-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.dg-sidebar-open .dg-sidebar {
        transform: translateX(0);
        box-shadow: var(--dg-shadow-lg);
    }
    body.dg-sidebar-open .dg-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(10, 24, 20, .45);
    }
    .dg-main {
        margin-left: 0;
    }
    .dg-topbar {
        padding: 0 16px;
        gap: 12px;
    }
    .dg-content {
        padding: 20px 16px 32px;
    }
    .dg-auth-split {
        grid-template-columns: 1fr;
    }
    .dg-auth-brand {
        display: none;
    }
    .dg-auth-card .dg-auth-mobile-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 28px;
    }
    .dg-auth-card .dg-auth-mobile-logo .dg-wordmark {
        color: var(--dg-ink);
    }
}

@media (max-width: 575.98px) {
    .dg-office span {
        max-width: 46vw;
    }
    .dg-badge {
        display: none;
    }
    .dg-welcome {
        padding: 22px 20px;
    }
    .dg-welcome-meta {
        align-items: flex-start;
    }
    .dg-content > .card.p-5,
    .dg-content > .card.p-md-5 {
        padding: 4px 16px 16px !important;
    }
    .dg-content > .card.p-5 > .card-header,
    .dg-content > .card.p-md-5 > .card-header {
        margin: 0 -16px 16px;
        padding: 14px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}

@media print {
    .dg-sidebar, .dg-topbar, .dg-footer, .dg-sidebar-backdrop {
        display: none !important;
    }
    .dg-main {
        margin-left: 0;
    }
}
