/* ==========================================================================
   Agenda Pimpinan - Front Page Stylesheet (front.css)
   Design System: Tabler UI Modern
   Fonts: Inter (Body & UI) & Lato (Heading) - 100% Akses Lokal
   ========================================================================== */

/* --- Konfigurasi Tipografi & Warna Tabler --- */
:root {
    --tblr-font-sans-serif: 'Inter', sans-serif;
    --tblr-font-monospace: 'Inter', sans-serif;
    --tblr-body-font-family: 'Inter', sans-serif;
    --tblr-body-bg: #f4f6fa;
    --tblr-body-color: #1e293b;
    --tblr-primary: #dc3545;
    --tblr-primary-rgb: 220, 53, 69;
}

body,
button,
input,
select,
textarea,
.table,
.badge,
.btn {
    font-family: 'Inter', sans-serif !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.card-title,
.agenda-title,
.agenda-item-title,
.empty-title {
    font-family: 'Lato', sans-serif !important;
    font-weight: 700;
}

/* --- Layout Dasar --- */
.page {
    background: #f4f6fa;
    background-image: radial-gradient(at 0% 0%, rgba(220, 38, 38, 0.03) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(2, 132, 199, 0.03) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* --- Header / Navbar (Sesuai Proporsi cirebonkota.go.id) --- */
.portal-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(4, 32, 69, 0.08);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .portal-navbar {
        padding: 0.85rem 0;
    }
}

.header-logo-pemkot {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    color: inherit;
    transition: opacity 0.15s ease;
}

.header-brand-link:hover {
    text-decoration: none !important;
    color: inherit;
    opacity: 0.88;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 0.75rem;
    font-family: 'Inter', sans-serif;
    min-width: 0;
}

.brand-org {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
}

.brand-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .header-logo-pemkot {
        height: 42px;
    }
    .brand-org {
        font-size: 0.68rem;
    }
    .brand-sub {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .header-logo-pemkot {
        height: 36px;
    }
    .header-brand-text {
        margin-left: 0.55rem;
    }
    .brand-org {
        font-size: 0.58rem;
        letter-spacing: 0.05em;
    }
    .brand-sub {
        font-size: 0.875rem;
    }
}

@media (max-width: 380px) {
    .brand-org {
        display: none;
    }
}

/* Tombol Masuk Khas Tabler */
.btn-portal-login {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc3545;
    background-color: #ffffff;
    border: 1px solid #dc3545;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
    height: 38px;
    line-height: 1;
}

.btn-portal-login:hover {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.15);
}

.btn-portal-login:focus {
    outline: 2px solid rgba(220, 53, 69, 0.35);
    outline-offset: 2px;
}

/* --- Hero Banner Resmi Kota Cirebon (Gradasi Merah #dc3545) --- */
.portal-hero {
    position: relative;
    background: linear-gradient(135deg, #a71d2a 0%, #c82333 45%, #dc3545 100%);
    padding: 2.5rem 0 2.75rem;
    color: #ffffff;
    border-bottom: 3px solid #84161f;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .portal-hero {
        padding: 2rem 0 2.25rem;
    }
}

.portal-hero-content {
    position: relative;
}

.portal-hero-kicker {
    display: inline-block;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fecaca;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.45rem;
}

.portal-hero-title {
    font-family: 'Lato', sans-serif !important;
    font-size: 2.15rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 0.65rem;
    letter-spacing: -0.01em;
}

@media (max-width: 767.98px) {
    .portal-hero-title {
        font-size: 1.6rem;
    }
}

.portal-hero-desc {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    max-width: 580px;
}

/* Kartu Tanggal di dalam Hero */
.portal-date-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #0f172a;
    width: 370px;
    max-width: 100%;
    box-sizing: border-box;
}

.portal-date-header {
    margin-bottom: 0.85rem;
}

.portal-date-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.portal-badge-today {
    display: inline-flex;
    align-items: center;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.725rem;
    font-weight: 600;
    color: #0f172a;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    line-height: 1.3;
}

.portal-date-count {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #64748b;
    margin-top: 0.2rem;
    line-height: 1.3;
}

/* Controls Bar (Nav Group + Reset Button) */
.portal-date-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-date-nav-group {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
    height: 40px;
    box-sizing: border-box;
}

.btn-date-step {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    text-decoration: none !important;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.btn-date-step:hover {
    color: #0f172a;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.date-picker-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    height: 32px;
    padding: 0 0.4rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-picker-field:focus-within {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.portal-native-date-input {
    border: none !important;
    background: transparent !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0f172a;
    padding: 0;
    height: 30px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    outline: none;
}

/* Tombol Reset ke Hari Ini */
.btn-reset-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 0.75rem;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-reset-today:not(.is-disabled):hover {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-reset-today.is-disabled {
    opacity: 0.55;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: default;
    pointer-events: none;
}

/* --- Control Bar (Search & View Switcher) --- */
.agenda-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.agenda-search-wrapper {
    position: relative;
    flex: 1 1 320px;
    max-width: 500px;
    width: 100%;
}

.agenda-search-input {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.6rem 1rem 0.6rem 2.45rem;
    font-size: 0.925rem;
    color: #1e293b;
    width: 100%;
    min-height: 42px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.agenda-search-input:focus {
    border-color: #dc3545;
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.search-icon-pos {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.9rem;
}

.view-toggle-group .btn {
    padding: 0.5rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
}

.view-toggle-group .btn.active {
    color: #ffffff !important;
    background-color: #0f172a !important;
    border-color: #0f172a !important;
}

/* --- Tracking Timeline View (Tampilan Itinerary / Tracking) --- */
.agenda-tracking-timeline,
.agenda-timeline-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0.65rem;
}

@media (min-width: 992px) {
    .agenda-tracking-timeline {
        max-height: 580px;
        overflow-y: auto;
        overflow-x: hidden;
        padding-left: 0.65rem;
        padding-right: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

.agenda-tracking-step {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.agenda-tracking-step:not(:last-child) {
    padding-bottom: 1.25rem;
}

/* Kolom Node & Garis Spine Tracking */
.tracking-node-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 32px;
    position: relative;
}

.tracking-node-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #dc3545;
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.15);
    z-index: 2;
    transition: all 0.2s ease-in-out;
}

.tracking-spine-line {
    flex: 1 1 auto;
    width: 2px;
    background-color: #cbd5e1;
    margin-top: 4px;
    margin-bottom: -4px;
    z-index: 1;
}

.agenda-tracking-step:last-child .tracking-spine-line {
    display: none;
}

.agenda-tracking-step:hover .tracking-node-marker {
    background-color: #dc3545;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
    transform: scale(1.06);
}

/* Kolom Kartu Acara */
.tracking-card-content {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .agenda-tracking-step {
        gap: 0.75rem;
    }
    .agenda-tracking-step:not(:last-child) {
        padding-bottom: 1rem;
    }
    .tracking-node-col {
        width: 28px;
    }
    .tracking-node-marker {
        width: 28px;
        height: 28px;
        font-size: 0.725rem;
    }
}

/* Header jam di luar kartu, sejajar dengan angka urutan di kirinya */
.tracking-time-header {
    display: flex;
    align-items: center;
    height: 32px;
    margin-bottom: 0.5rem;
}

.tracking-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.35;
    color: #0f172a;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

@media (max-width: 575.98px) {
    .tracking-time-header {
        height: 28px;
        margin-bottom: 0.45rem;
    }
    .tracking-time-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.55rem;
    }
}

/* Kartu Informasi Agenda */
.agenda-item-card {
    background: #ffffff;
    border: 1px solid rgba(4, 32, 69, 0.08);
    border-radius: 8px;
    padding: 1.125rem 1.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.agenda-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* 1. Header Kartu: Judul & Lokasi */
.agenda-item-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.agenda-item-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.025rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    margin: 0;
}

/* Ikon Seragam untuk Metadata Kegiatan (Lokasi, Asal Surat, Pakaian, Pejabat / Disposisi) */
.agenda-field-icon {
    color: #dc3545 !important;
    font-size: 0.8rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
}

.agenda-item-location {
    font-family: 'Inter', sans-serif !important;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.45;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.location-venue {
    font-weight: 500;
    color: #334155;
}

.location-sep {
    color: #cbd5e1;
}

.location-address {
    font-weight: 400;
    color: #64748b;
}

/* 2. Baris Asal Surat & Pakaian (Berdampingan Bersama Disposisi Tanpa Garis Pembatas) */
.agenda-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.5rem;
}

.agenda-meta-item,
.agenda-item-organizer,
.meta-chip-organizer {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.775rem;
    color: #64748b;
    font-weight: 400;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.agenda-meta-item .meta-val,
.agenda-item-organizer .organizer-val,
.meta-chip-organizer .organizer-val {
    font-weight: 500;
    color: #334155;
}

/* 3. Baris Disposisi (Tanpa Garis Pembatas) */
.agenda-disposisi-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.disposisi-label {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.775rem;
    font-weight: 400;
    color: #64748b;
    text-transform: none;
    letter-spacing: normal;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.meta-val-empty {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1;
}

.disposisi-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.disposisi-chips .meta-chip-disposisi {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.775rem;
    padding: 0.2rem 0.55rem;
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.22);
    border-radius: 4px;
    font-weight: 500;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
}

/* --- Tampilan Tabel (Opsi B) --- */
.agenda-table-card {
    background: #ffffff;
    border: 1px solid rgba(4, 32, 69, 0.08);
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

@media (min-width: 992px) {
    .agenda-table-card .table-responsive {
        max-height: 580px;
        overflow-y: auto;
        position: relative;
    }
}

.table-agenda {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 960px;
}

.table-agenda thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 0.85rem;
    border-bottom: 1px solid rgba(4, 32, 69, 0.08);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 rgba(4, 32, 69, 0.08);
}

.table-agenda thead th.text-center,
.table-agenda tbody td.text-center {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.table-agenda tbody td {
    padding: 1rem 0.85rem;
    vertical-align: top;
    font-size: 0.885rem;
    color: #1e293b;
    border-bottom: 1px solid rgba(4, 32, 69, 0.05);
    word-break: break-word;
    overflow-wrap: break-word;
}

.table-agenda tbody tr:last-child td {
    border-bottom: none;
}

.table-agenda tbody tr:hover {
    background-color: #fcfdfe;
}

.table-agenda .badge {
    white-space: normal !important;
    text-align: left;
    display: inline-flex;
    align-items: flex-start;
    line-height: 1.35;
    padding: 0.3rem 0.55rem;
    font-weight: 500;
    font-size: 0.8125rem;
}

.table-agenda .badge i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* --- Scrollbar Modern & Halus untuk Jadwal dan Tabel --- */
@media (min-width: 992px) {
    .agenda-tracking-timeline,
    .agenda-table-card .table-responsive {
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
    }

    .agenda-tracking-timeline::-webkit-scrollbar,
    .agenda-table-card .table-responsive::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .agenda-tracking-timeline::-webkit-scrollbar-track,
    .agenda-table-card .table-responsive::-webkit-scrollbar-track {
        background: transparent;
    }

    .agenda-tracking-timeline::-webkit-scrollbar-thumb,
    .agenda-table-card .table-responsive::-webkit-scrollbar-thumb {
        background-color: rgba(100, 116, 139, 0.28);
        border-radius: 6px;
    }

    .agenda-tracking-timeline::-webkit-scrollbar-thumb:hover,
    .agenda-table-card .table-responsive::-webkit-scrollbar-thumb:hover {
        background-color: rgba(100, 116, 139, 0.5);
    }
}

/* --- Empty State Khas Tabler (Ilustrasi Terpusat) --- */
.agenda-empty-card {
    background: #ffffff;
    border: 1px solid rgba(4, 32, 69, 0.08);
    border-radius: 12px;
    padding: 3.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1.25rem 0;
}

.agenda-empty-card .empty-img {
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.agenda-empty-card .empty-img img {
    height: 160px;
    max-width: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
}

.agenda-empty-card .empty-title {
    font-family: 'Lato', sans-serif !important;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    text-align: center;
}

.agenda-empty-card .empty-subtitle {
    font-family: 'Inter', sans-serif !important;
    color: #64748b;
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
    text-align: center;
}

.agenda-empty-card .empty-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* --- Footer --- */
.portal-footer {
    background-color: #ffffff;
    border-top: 1px solid rgba(4, 32, 69, 0.08);
    padding: 1.25rem 0;
    color: #64748b;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-text {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}