/*!
 * IDDS Admin — Tanggamus CMS console (human editorial, 2026)
 * Calm ink + paper. No neon, no purple glow, no glass-for-glass-sake.
 */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
    --idds-a-primary: #1a365d;
    --idds-a-primary-600: #234e82;
    --idds-a-accent: #a67c2a;
    --idds-a-bg: #eef1f5;
    --idds-a-surface: #ffffff;
    --idds-a-border: #dde3ec;
    --idds-a-border-strong: #c5cedb;
    --idds-a-text: #152033;
    --idds-a-muted: #5b6b82;
    --idds-a-radius: 12px;
    --idds-a-radius-sm: 8px;
    --idds-a-shadow: 0 1px 2px rgba(21, 32, 51, .04), 0 6px 18px rgba(21, 32, 51, .05);
    --idds-a-shadow-lg: 0 10px 28px rgba(21, 32, 51, .08);
    --idds-a-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --idds-a-display: "Source Serif 4", Georgia, "Times New Roman", serif;
    --idds-a-sidebar: #101826;
}

/* ==========================================================================
   BASE
   ========================================================================== */
body,
.wrapper {
    font-family: var(--idds-a-font) !important;
}
body {
    background: var(--idds-a-bg) !important;
    color: var(--idds-a-text);
    -webkit-font-smoothing: antialiased;
}
.content-wrapper { background: var(--idds-a-bg) !important; }
.content-header { padding: 1.25rem 1.5rem .35rem; }
.content-header h1 {
    font-family: var(--idds-a-display) !important;
    font-weight: 700 !important;
    letter-spacing: -.02em;
    font-size: 1.45rem !important;
    color: var(--idds-a-text);
}
.breadcrumb {
    background: transparent;
    padding-left: 0;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--idds-a-muted); }
.breadcrumb-item a { color: var(--idds-a-primary); font-weight: 600; }
.content { padding: .75rem 1.5rem 1.75rem; }

/* ==========================================================================
   SIDEBAR / NAVBAR
   ========================================================================== */
.main-sidebar {
    background: linear-gradient(185deg, #0f1624 0%, #151e30 55%, #121a28 100%) !important;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04), 8px 0 28px rgba(16, 24, 40, .12);
}
/* Compact brand lockup — crest + label (fixes oversized logo) */
.brand-link.idds-brand,
.main-sidebar .brand-link {
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, .07) !important;
    padding: .85rem 1rem !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent !important;
}
.brand-link .brand-image,
.brand-link .idds-brand__mark,
.main-sidebar .brand-link img,
.idds-brand__mark {
    float: none !important;
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1 !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
    flex: 0 0 36px !important;
}
.brand-link .brand-text,
.idds-brand__text {
    display: block !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--idds-a-font) !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    letter-spacing: -.015em !important;
    line-height: 1.25 !important;
    color: rgba(255, 255, 255, .92) !important;
    white-space: normal !important;
    max-width: 148px;
    opacity: 1 !important;
}
.nav-sidebar .nav-header {
    color: rgba(255, 255, 255, .38) !important;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: .55rem;
}
.nav-sidebar .nav-item > .nav-link {
    border-radius: 8px;
    margin: 1px 8px;
    color: rgba(255, 255, 255, .72) !important;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-sidebar .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, .06) !important;
    color: #fff !important;
}
.nav-sidebar .nav-item > .nav-link.active {
    background: #1a365d !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--idds-a-accent);
}
.nav-sidebar .nav-link p { font-size: .875rem; }
.main-header.navbar {
    background: rgba(255, 255, 255, .94) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--idds-a-border) !important;
    box-shadow: none;
}
.main-footer {
    background: transparent !important;
    border-top: 1px solid var(--idds-a-border) !important;
    color: var(--idds-a-muted);
    font-size: .85rem;
}

/* ==========================================================================
   CARDS / BOXES
   ========================================================================== */
.card {
    border: 1px solid var(--idds-a-border) !important;
    border-radius: var(--idds-a-radius) !important;
    box-shadow: var(--idds-a-shadow) !important;
    background: var(--idds-a-surface);
    overflow: hidden;
}
/* Theme preset list — denser, clearer identity chips */
.preset-list, .domain-preset, [data-preset] {
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tpl-item__media {
    background: #101826 !important;
    border-radius: 10px;
    overflow: hidden;
}
.tpl-item__media img {
    object-fit: cover;
    width: 100%;
    min-height: 160px;
}
.card-header {
    background: var(--idds-a-surface) !important;
    border-bottom: 1px solid var(--idds-a-border) !important;
    padding: 1rem 1.25rem !important;
}
.card-header .card-title {
    font-weight: 750;
    font-size: 1.02rem;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--idds-a-text);
}
.card-body { padding: 1.15rem 1.25rem; }
.card-footer {
    background: #f8fafc !important;
    border-top: 1px solid var(--idds-a-border) !important;
}
.card-outline { border-top-width: 3px !important; }
.small-box {
    border-radius: var(--idds-a-radius);
    box-shadow: var(--idds-a-shadow) !important;
    overflow: hidden;
}

/* ==========================================================================
   BUTTONS / FORMS
   ========================================================================== */
.btn {
    border-radius: var(--idds-a-radius-sm);
    font-weight: 650;
    letter-spacing: -.01em;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--idds-a-primary) !important;
    border-color: transparent !important;
    box-shadow: none;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--idds-a-primary-600) !important;
}
.btn-outline-secondary {
    border-color: var(--idds-a-border-strong);
    color: var(--idds-a-text);
}
.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: var(--idds-a-border-strong);
    color: var(--idds-a-text);
}
.btn-xs, .btn-sm { border-radius: 8px; }
.btn-group-sm > .btn { border-radius: 8px; }

.form-control, .custom-select, .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--idds-a-radius-sm) !important;
    border-color: var(--idds-a-border-strong) !important;
    min-height: 40px;
}
.form-control:focus, .custom-select:focus {
    border-color: var(--idds-a-primary) !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, .15) !important;
}
.input-group-text {
    border-radius: var(--idds-a-radius-sm);
    border-color: var(--idds-a-border-strong);
    background: #f8fafc;
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 1.45rem 1.6rem;
    margin-bottom: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #101826 0%, #1a365d 100%);
    box-shadow: var(--idds-a-shadow);
}
.dash-hero::after { display: none; }
.dash-hero__inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
.dash-hero__kicker {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: rgba(255,255,255,.75); margin-bottom: .45rem;
}
.dash-hero__title {
    font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .35rem;
    color: #fff !important;
}
.dash-hero__desc { margin: 0; color: rgba(255,255,255,.82); max-width: 520px; font-size: .95rem; }
.dash-hero__meta {
    display: flex; gap: .6rem; flex-wrap: wrap;
}
.dash-hero__chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: .4rem .85rem;
    font-size: .8rem; font-weight: 600;
    backdrop-filter: blur(8px);
}

.dash-metrics { margin-bottom: .5rem; }
.dash-metric {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    height: 100%;
}
.dash-metric__card {
    height: 100%;
    background: var(--idds-a-surface);
    border: 1px solid var(--idds-a-border);
    border-radius: 16px;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--idds-a-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    display: flex; align-items: center; gap: .95rem;
    position: relative;
    overflow: hidden;
}
.dash-metric__card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--metric-accent, var(--idds-a-primary));
}
.dash-metric:hover .dash-metric__card {
    transform: translateY(-3px);
    box-shadow: var(--idds-a-shadow-lg);
    border-color: color-mix(in srgb, var(--metric-accent, var(--idds-a-primary)) 35%, var(--idds-a-border));
}
.dash-metric__ico {
    width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--metric-accent, var(--idds-a-primary)) 12%, #fff);
    color: var(--metric-accent, var(--idds-a-primary));
    font-size: 1.15rem;
}
.dash-metric__label {
    display: block;
    font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--idds-a-muted); margin-bottom: .15rem;
}
.dash-metric__value {
    display: block;
    font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
    color: var(--idds-a-text);
}
.dash-metric--posts { --metric-accent: #1e40af; }
.dash-metric--pages { --metric-accent: #b91c1c; }
.dash-metric--categories { --metric-accent: #047857; }
.dash-metric--tags { --metric-accent: #b45309; }
.dash-metric--users { --metric-accent: #4338ca; }
.dash-metric--roles { --metric-accent: #9d174d; }
.dash-metric--contacts { --metric-accent: #0f766e; }
.dash-metric--galleries { --metric-accent: #6d28d9; }

.dash-section-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    margin: 1.5rem 0 .9rem;
}
.dash-section-title h2 {
    font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; margin: 0;
}
.dash-section-title a {
    font-size: .85rem; font-weight: 700; color: var(--idds-a-primary);
}

.dash-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.dash-quick__item {
    display: flex; align-items: center; gap: .65rem;
    padding: .85rem 1rem;
    background: var(--idds-a-surface);
    border: 1px solid var(--idds-a-border);
    border-radius: 12px;
    color: var(--idds-a-text) !important;
    text-decoration: none !important;
    font-weight: 650; font-size: .9rem;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.dash-quick__item i {
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eff6ff; color: var(--idds-a-primary);
}
.dash-quick__item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--idds-a-primary) 30%, var(--idds-a-border));
    box-shadow: var(--idds-a-shadow);
}

/* Legacy info-box polish (other pages) */
.info-box {
    border-radius: var(--idds-a-radius) !important;
    box-shadow: var(--idds-a-shadow) !important;
    border: 1px solid var(--idds-a-border);
    min-height: 90px;
}
.info-box .info-box-icon { border-radius: 12px; width: 70px; }
.link-info-box { color: inherit !important; text-decoration: none !important; }

/* ==========================================================================
   TABLES + DATATABLES
   ========================================================================== */
.table {
    color: var(--idds-a-text);
    margin-bottom: 0;
}
.table thead th {
    text-transform: uppercase;
    font-size: .7rem !important;
    letter-spacing: .05em;
    font-weight: 750 !important;
    color: var(--idds-a-muted) !important;
    border-bottom: 1px solid var(--idds-a-border) !important;
    border-top: 0 !important;
    background: #f8fafc !important;
    padding: .85rem 1rem !important;
    white-space: nowrap;
    vertical-align: middle;
}
.table td, .table th {
    border-top: 1px solid var(--idds-a-border) !important;
    padding: .85rem 1rem !important;
    vertical-align: middle !important;
}
.table-hover tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { background-color: #f1f5f9 !important; }
.table-striped tbody tr:nth-of-type(odd) { background-color: #fcfdff; }

/* DataTables wrapper */
div.dataTables_wrapper {
    padding-top: .15rem;
}
div.dataTables_wrapper .dataTables_length,
div.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}
div.dataTables_wrapper .dataTables_length label,
div.dataTables_wrapper .dataTables_filter label {
    font-weight: 600;
    color: var(--idds-a-muted);
    font-size: .85rem;
}
div.dataTables_wrapper .dataTables_length select,
div.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--idds-a-border-strong) !important;
    border-radius: 10px !important;
    padding: .4rem .7rem !important;
    margin-left: .4rem;
    background: #fff;
    box-shadow: none !important;
}
div.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--idds-a-primary) !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, .12) !important;
    outline: 0;
}
div.dataTables_wrapper .dataTables_info {
    color: var(--idds-a-muted);
    font-size: .82rem;
    font-weight: 500;
    padding-top: 1rem !important;
}
div.dataTables_wrapper .dataTables_paginate {
    padding-top: .85rem !important;
}
div.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    margin: 0 2px !important;
    padding: .35rem .7rem !important;
    font-weight: 650 !important;
    color: var(--idds-a-text) !important;
    background: transparent !important;
}
div.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #eef2ff !important;
    border-color: #e0e7ff !important;
    color: var(--idds-a-primary) !important;
}
div.dataTables_wrapper .dataTables_paginate .paginate_button.current,
div.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--idds-a-primary-600), var(--idds-a-primary)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(30, 58, 138, .25);
}
div.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
div.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #94a3b8 !important;
    background: transparent !important;
    border-color: transparent !important;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
}

/* Action buttons in tables */
.table .btn-group-sm > .btn,
.table .btn-sm {
    min-width: 34px;
    padding: .35rem .55rem;
}
.table .btn-warning { background: #f59e0b; border-color: #f59e0b; color: #111; }
.table .btn-danger { background: #dc2626; border-color: #dc2626; }
.table .btn-info { background: #0284c7; border-color: #0284c7; color: #fff; }

/* Custom checkbox polish */
.custom-control-label::before {
    border-radius: 6px;
    border-color: var(--idds-a-border-strong);
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--idds-a-primary);
    border-color: var(--idds-a-primary);
}

/* Card tools select (language filter etc.) */
.card-tools .form-control,
.card-tools .custom-select,
.card-tools select {
    min-width: 160px;
    height: 38px;
    font-size: .85rem;
    font-weight: 600;
}

/* ==========================================================================
   BADGES / ALERTS / MISC
   ========================================================================== */
.badge {
    border-radius: 999px;
    padding: .4em .75em;
    font-weight: 700;
    letter-spacing: .02em;
}
.alert {
    border-radius: var(--idds-a-radius-sm);
    border: 0;
    box-shadow: var(--idds-a-shadow);
}
.modal-content { border-radius: 16px; border: 0; box-shadow: var(--idds-a-shadow-lg); }
.modal-header { border-bottom-color: var(--idds-a-border); }
.modal-footer { border-top-color: var(--idds-a-border); background: #f8fafc; }
.page-item.active .page-link {
    background: var(--idds-a-primary);
    border-color: var(--idds-a-primary);
}
.page-link { border-radius: 8px !important; margin: 0 2px; color: var(--idds-a-primary); }

/* Select2 dropdown */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--idds-a-primary) !important;
}
.select2-dropdown {
    border-color: var(--idds-a-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--idds-a-shadow-lg);
    overflow: hidden;
}

/* Toastr / Pace mild tuning */
.pace .pace-progress { background: var(--idds-a-accent) !important; }

/* Dark mode compatibility (AdminLTE darkmode class) */
body.dark-mode,
body.dark-mode .content-wrapper {
    --idds-a-bg: #0f172a;
    --idds-a-surface: #1e293b;
    --idds-a-border: #334155;
    --idds-a-text: #e2e8f0;
    --idds-a-muted: #94a3b8;
}
body.dark-mode .card,
body.dark-mode .dash-metric__card,
body.dark-mode .dash-quick__item {
    background: var(--idds-a-surface);
}
body.dark-mode .table thead th { background: #0f172a !important; }
body.dark-mode .table-hover tbody tr:hover { background-color: #243247 !important; }
body.dark-mode .main-header.navbar { background: rgba(15, 23, 42, .92) !important; }

@media (max-width: 767.98px) {
    .content { padding-left: 1rem; padding-right: 1rem; }
    .dash-hero { padding: 1.25rem; }
    .dash-hero__title { font-size: 1.35rem; }
}
