/* =========================================================
   PT Lisna Syifa Prima theme — the single source of truth for the app's look.

   Loaded on every page: the AdminLTE layout (layouts/adminlte.blade.php)
   and the standalone login screen both link this file, so a new page picks
   up the palette, the page background and the shared components for free.

   Page-level <style> blocks should use these tokens rather than
   re-declaring their own hex values.
   ========================================================= */

:root {
    /* Brand — matches the teal already used across the app's pages */
    --hd-teal: #2daaa2;
    --hd-teal-dark: #248f88;
    --hd-teal-deeper: #155249;
    --hd-teal-deep: #0d3d38;
    --hd-teal-soft: #e6f6f5;
    --hd-mint: #b7ead9;
    --hd-gradient: linear-gradient(135deg, #2daaa2 0%, #248f88 100%);

    /* Accents */
    --hd-green: #27ae60;
    --hd-amber: #f0a500;
    --hd-red: #e74c5e;
    --hd-blue: #2f80ed;
    --hd-purple: #7d5fe0;

    /* Neutrals */
    --hd-ink: #243746;
    --hd-muted: #718096;
    --hd-line: #e6efed;
    --hd-canvas: #eef8f5;

    --hd-bg-soft: #f7fafc;
    --hd-radius: 14px;
    --hd-radius-sm: 10px;
    --hd-shadow: 0 6px 18px rgba(45, 170, 162, .07);
    --hd-shadow-hover: 0 4px 16px rgba(45, 170, 162, .18);
    --sidebar-width: 250px;
}

/* ---------- Base surfaces ---------- */

body.hold-transition {
    background-color: #eef8f5;
}

.content-wrapper {
    background: linear-gradient(180deg, #f7fdfb 0%, #eef8f5 45%, #e9f5f2 100%);
    position: relative;
}

/* Soft decorative wash behind the page header */
.content-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 340px;
    pointer-events: none;
    background:
        radial-gradient(110% 100% at 88% -35%, rgba(45, 170, 162, .13), transparent 62%),
        radial-gradient(80% 80% at 62% -45%, rgba(39, 174, 96, .08), transparent 60%);
}

.content-wrapper>* {
    position: relative;
}

/* Pages that render their own header have no .content-header to space them out */
.content-wrapper>.content:first-child {
    padding-top: 1.25rem;
}

.main-header.navbar {
    background-color: #fff;
    border-bottom: 1px solid var(--hd-line);
}

.main-footer {
    background-color: #fff;
    border-top: 1px solid var(--hd-line);
    color: var(--hd-muted);
    font-size: .82rem;
}

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

.main-sidebar,
.main-sidebar::before {
    width: var(--sidebar-width);
}

body.sidebar-mini:not(.sidebar-collapse) .content-wrapper,
body.sidebar-mini:not(.sidebar-collapse) .main-header,
body.sidebar-mini:not(.sidebar-collapse) .main-footer {
    margin-left: var(--sidebar-width) !important;
}

.main-sidebar {
    background: linear-gradient(180deg,
            #ffffff 0%,
            #ffffff 52%,
            #e4f6f1 72%,
            #a9e0d3 88%,
            #74cbba 100%);
}

.main-sidebar .brand-link {
    display: flex;
    align-items: center;
    background-color: #fff;
    color: var(--hd-ink);
    border-bottom: 1px solid var(--hd-line);
    padding: .8125rem .75rem;
}

/* Teal tile carrying the white brand mark */
.main-sidebar .brand-logo-tile {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--hd-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: .7rem;
    box-shadow: 0 4px 10px rgba(45, 170, 162, .3);
}

.main-sidebar .brand-logo-tile img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.main-sidebar .brand-link .brand-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hd-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-sidebar .user-panel {
    border-bottom: 1px solid var(--hd-line) !important;
}

.main-sidebar .user-panel .info a {
    color: var(--hd-ink);
}

/* Sidebar makes room for the brandmark pinned to the bottom */
.main-sidebar .sidebar {
    display: flex;
    flex-direction: column;
}

/* Never compress the panels when the menu is taller than the viewport */
.main-sidebar .sidebar>* {
    flex-shrink: 0;
}

.nav-sidebar .nav-header {
    color: var(--hd-muted) !important;
}

.nav-sidebar .nav-link p {
    white-space: nowrap;
}

.nav-sidebar .nav-link {
    color: #4a5c6b;
    border-radius: 8px;
}

.nav-sidebar>.nav-item>.nav-link:hover,
.nav-sidebar .nav-treeview>.nav-item>.nav-link:hover {
    background-color: rgba(45, 170, 162, .1);
    color: var(--hd-teal-dark);
}

.nav-sidebar>.nav-item>.nav-link.active,
.nav-sidebar .nav-treeview>.nav-item>.nav-link.active {
    background-color: var(--hd-teal);
    color: #fff;
    box-shadow: 0 4px 10px rgba(45, 170, 162, .28);
}

.nav-sidebar .karyawan-submenu>.nav-item>.nav-link,
.nav-sidebar .attendance-submenu>.nav-item>.nav-link,
.nav-sidebar .timeoff-submenu>.nav-item>.nav-link,
.nav-sidebar .overtime-submenu>.nav-item>.nav-link,
.nav-sidebar .business-trips-submenu>.nav-item>.nav-link,
.nav-sidebar .payroll-submenu>.nav-item>.nav-link {
    padding-left: 2.65rem;
}

.nav-sidebar .karyawan-submenu>.nav-item>.nav-link .nav-icon,
.nav-sidebar .attendance-submenu>.nav-item>.nav-link .nav-icon,
.nav-sidebar .timeoff-submenu>.nav-item>.nav-link .nav-icon,
.nav-sidebar .overtime-submenu>.nav-item>.nav-link .nav-icon,
.nav-sidebar .business-trips-submenu>.nav-item>.nav-link .nav-icon,
.nav-sidebar .payroll-submenu>.nav-item>.nav-link .nav-icon {
    width: 1rem;
    margin-right: .55rem;
    font-size: .52rem;
}

/* Disabled sidebar items: not-allowed cursor, no hover effect */
.nav-sidebar .nav-item-disabled {
    cursor: not-allowed;
}

.nav-sidebar .nav-item-disabled .nav-link:hover,
.nav-sidebar .nav-item-disabled .nav-link:focus {
    background-color: transparent !important;
    color: #4a5c6b !important;
}

/* Brandmark watermark at the bottom of the sidebar */
.sidebar-brandmark {
    position: relative;
    margin-top: auto;
    padding: 3.5rem .75rem 1.25rem;
    overflow: hidden;
}

.sidebar-brandmark-mark {
    position: absolute;
    left: .4rem;
    top: .25rem;
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: .55;
    pointer-events: none;
}

.sidebar-brandmark-title {
    position: relative;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--hd-teal-dark);
    margin-bottom: .25rem;
}

.sidebar-brandmark-desc {
    position: relative;
    font-size: .72rem;
    line-height: 1.35;
    color: rgba(36, 143, 136, .85);
    margin: 0;
}

@media (max-width: 991.98px) {

    body.sidebar-mini:not(.sidebar-collapse) .content-wrapper,
    body.sidebar-mini:not(.sidebar-collapse) .main-header,
    body.sidebar-mini:not(.sidebar-collapse) .main-footer {
        margin-left: 0 !important;
    }
}

/* ---------- Cards ---------- */

.hd-card {
    background-color: #fff;
    border: 1px solid var(--hd-line);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow);
    margin-bottom: 1.25rem;
    height: calc(100% - 1.25rem);
}

.hd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--hd-line);
}

.hd-card-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--hd-ink);
}

.hd-card-title i {
    color: var(--hd-teal);
    margin-right: .45rem;
}

.hd-card-body {
    padding: 1.15rem;
}

.hd-card-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--hd-teal-dark);
}

/* ---------- Greeting + clock ---------- */

.hd-greeting-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hd-ink);
    margin: 0 0 .4rem;
}

.hd-greeting-meta {
    font-size: .88rem;
    color: var(--hd-muted);
}

.hd-greeting-meta .hd-sep {
    margin: 0 .5rem;
    opacity: .5;
}

.hd-clock {
    display: inline-flex;
    align-items: center;
    background: var(--hd-gradient);
    color: #fff;
    border-radius: var(--hd-radius);
    padding: .8rem 1.25rem;
    box-shadow: 0 10px 22px rgba(13, 111, 102, .25);
}

.hd-clock i {
    font-size: 1.5rem;
    opacity: .85;
    margin-right: .75rem;
}

.hd-clock-time {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
}

.hd-clock-date {
    font-size: .75rem;
    opacity: .85;
}

/* ---------- Stat cards ---------- */

.hd-stat {
    display: flex;
    align-items: flex-start;
}

.hd-stat-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    margin-right: 1rem;
}

.hd-stat-label {
    font-size: .85rem;
    color: var(--hd-muted);
    margin-bottom: .1rem;
}

.hd-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--hd-ink);
    line-height: 1.15;
}

.hd-stat-value small {
    font-size: .95rem;
    font-weight: 600;
    color: var(--hd-muted);
}

.hd-stat-delta {
    font-size: .76rem;
    margin-top: .3rem;
}

/* ---------- Tones ---------- */

.hd-bg-teal {
    background-color: var(--hd-teal);
}

.hd-bg-green {
    background-color: var(--hd-green);
}

.hd-bg-amber {
    background-color: var(--hd-amber);
}

.hd-bg-red {
    background-color: var(--hd-red);
}

.hd-bg-blue {
    background-color: var(--hd-blue);
}

.hd-bg-purple {
    background-color: var(--hd-purple);
}

.hd-text-teal {
    color: var(--hd-teal-dark);
}

.hd-text-green {
    color: var(--hd-green);
}

.hd-text-amber {
    color: var(--hd-amber);
}

.hd-text-red {
    color: var(--hd-red);
}

.hd-text-muted {
    color: var(--hd-muted);
}

/* ---------- Progress ---------- */

.hd-progress {
    height: 6px;
    border-radius: 99px;
    background-color: #eef2f1;
    overflow: hidden;
    margin-top: .75rem;
}

.hd-progress-bar {
    height: 100%;
    border-radius: 99px;
}

.hd-progress-caption {
    display: flex;
    justify-content: flex-end;
    font-size: .72rem;
    font-weight: 600;
    color: var(--hd-muted);
    margin-top: .25rem;
}

/* ---------- Pills / segments ---------- */

.hd-pill {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 600;
    padding: .18rem .6rem;
    border-radius: 99px;
}

.hd-pill i {
    margin-right: .3rem;
}

.hd-pill-green {
    background-color: #e6f7ee;
    color: #1e8e4f;
}

.hd-pill-teal {
    background-color: #e2f4f1;
    color: var(--hd-teal-dark);
}

.hd-pill-amber {
    background-color: #fdf3dd;
    color: #b47b00;
}

.hd-pill-blue {
    background-color: #e8f0fd;
    color: #2264c4;
}

/* ---------- Bar list ---------- */

.hd-bar-row {
    display: flex;
    align-items: center;
    font-size: .8rem;
    margin-bottom: .7rem;
}

.hd-bar-row:last-child {
    margin-bottom: 0;
}

.hd-bar-label {
    flex: 0 0 96px;
    width: 96px;
    color: var(--hd-muted);
    padding-right: .5rem;
}

.hd-bar-track {
    display: block;
    flex: 1 1 auto;
    height: 9px;
    border-radius: 99px;
    background-color: #f0f4f3;
    overflow: hidden;
}

.hd-bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
}

.hd-bar-value {
    flex: 0 0 42px;
    width: 42px;
    text-align: right;
    font-weight: 600;
    color: var(--hd-ink);
}

/* ---------- Inner panels / legends ---------- */

.hd-panel {
    border: 1px solid var(--hd-line);
    border-radius: 10px;
    padding: .9rem;
    height: 100%;
}

/* Chart.js resizes the canvas to its container, so the container owns the height */
.hd-chart {
    position: relative;
    height: 160px;
}

/* Donut + legend side by side instead of stacked */
.hd-chart-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.hd-chart-row .hd-chart {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
}

.hd-chart-row .hd-chart-side {
    flex: 1 1 auto;
    min-width: 0;
}

/* Narrower cards need a smaller donut to leave room for the legend text */
.hd-chart-row--sm .hd-chart {
    flex-basis: 96px;
    width: 96px;
    height: 96px;
}

.hd-panel-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--hd-ink);
    margin-bottom: .75rem;
}

.hd-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .8rem;
}

.hd-legend li {
    display: flex;
    align-items: center;
    margin-bottom: .5rem;
}

.hd-legend .hd-swatch {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: .5rem;
}

.hd-legend .hd-legend-value {
    font-weight: 700;
    color: var(--hd-ink);
    margin-right: .35rem;
}

.hd-legend .hd-legend-label {
    color: var(--hd-muted);
    overflow-wrap: break-word;
    min-width: 0;
}

.hd-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
    padding: .28rem 0;
}

.hd-list-row .hd-list-label {
    color: var(--hd-muted);
}

.hd-list-row .hd-list-value {
    font-weight: 700;
    color: var(--hd-ink);
}

.hd-total-note {
    font-size: .75rem;
    color: var(--hd-muted);
    margin-top: .75rem;
    margin-bottom: 0;
}

.hd-total-note strong {
    color: var(--hd-ink);
}

/* ---------- Page hero ----------
   Rendered by the <x-page-hero> Blade component. Every index/detail page
   opens with one of these, so the styling lives here rather than being
   re-declared per page. */

.hd-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--hd-gradient);
    color: #fff;
    border-radius: var(--hd-radius);
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(45, 170, 162, .22);
}

/* Faint leaf motif echoing the brand mark */
.hd-hero::after {
    content: "\f06c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 1.5rem;
    bottom: -2.5rem;
    font-size: 9rem;
    line-height: 1;
    color: rgba(255, 255, 255, .09);
    pointer-events: none;
}

.hd-hero-body {
    position: relative;
    z-index: 1;
}

.hd-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    color: #fff;
}

.hd-hero-title i {
    margin-right: .5rem;
    opacity: .9;
}

.hd-hero-desc {
    margin: 0;
    font-size: .88rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .88);
    max-width: 70ch;
}

.hd-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .8rem;
}

.hd-hero-meta span {
    padding: 5px 9px;
    background-color: rgba(255, 255, 255, .16);
    border-radius: 7px;
    font-size: .78rem;
}

.hd-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Buttons sitting on the teal ground read as light-on-dark */
.hd-hero .btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: .83rem;
}

.hd-hero .btn-light,
.hd-hero .btn-export {
    background-color: #fff;
    border-color: #fff;
    color: var(--hd-teal-dark);
}

.hd-hero .btn-light:hover,
.hd-hero .btn-export:hover {
    background-color: var(--hd-teal-soft);
    border-color: var(--hd-teal-soft);
    color: var(--hd-teal-dark);
}

@media (max-width: 767.98px) {
    .hd-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- Shared Bootstrap/AdminLTE primitives ----------
   These make an un-styled page look like the rest of the app without
   needing its own <style> block. */

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--hd-line);
    border-radius: var(--hd-radius) var(--hd-radius) 0 0 !important;
}

/* AdminLTE clearfixes .card-header with an ::after. When the header is made a
   flex container that empty pseudo-element becomes a third flex item, so
   justify-content-between lands the trailing button mid-row. */
.card-header.d-flex::after {
    display: none;
}

.card-primary.card-outline {
    border-top: 3px solid var(--hd-teal);
}

.btn-primary {
    background-color: var(--hd-teal);
    border-color: var(--hd-teal);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--hd-teal-dark);
    border-color: var(--hd-teal-dark);
}

.btn-outline-primary {
    color: var(--hd-teal-dark);
    border-color: var(--hd-teal);
}

.btn-outline-primary:hover {
    background-color: var(--hd-teal);
    border-color: var(--hd-teal);
}

.text-primary {
    color: var(--hd-teal-dark) !important;
}

.bg-primary,
.badge-primary {
    background-color: var(--hd-teal) !important;
}

a {
    color: var(--hd-teal-dark);
}

a:hover {
    color: var(--hd-teal);
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--hd-teal);
    box-shadow: 0 0 0 .2rem rgba(45, 170, 162, .15);
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--hd-line);
    color: var(--hd-muted);
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.page-item.active .page-link {
    background-color: var(--hd-teal);
    border-color: var(--hd-teal);
}

.page-link {
    color: var(--hd-teal-dark);
}

/* ---------- Page token aliases ----------
   Every module page used to declare its own private copy of this palette
   (--ot-*, --to-*, --att-*, --km-*, --shift-*, --loc-*, --detail-*), all
   holding the same values. Those local blocks are gone; the names now
   resolve here, so the palette can only be changed in one place.

   New pages should use the --hd-* tokens directly. */

:root {
    /* Overtime */
    --ot-primary: var(--hd-teal);
    --ot-primary-dark: var(--hd-teal-dark);
    --ot-primary-light: var(--hd-teal-soft);
    --ot-text: var(--hd-ink);
    --ot-text-muted: var(--hd-muted);
    --ot-border: var(--hd-line);
    --ot-bg-soft: var(--hd-bg-soft);
    --ot-radius: var(--hd-radius-sm);
    --ot-shadow: var(--hd-shadow);
    --ot-shadow-hover: var(--hd-shadow-hover);

    /* Time off */
    --to-primary: var(--hd-teal);
    --to-primary-dark: var(--hd-teal-dark);
    --to-primary-light: var(--hd-teal-soft);
    --to-text: var(--hd-ink);
    --to-text-muted: var(--hd-muted);
    --to-border: var(--hd-line);
    --to-bg-soft: var(--hd-bg-soft);
    --to-radius: var(--hd-radius-sm);
    --to-shadow: var(--hd-shadow);
    --to-shadow-hover: var(--hd-shadow-hover);

    /* Master karyawan */
    --km-primary: var(--hd-teal);
    --km-primary-dark: var(--hd-teal-dark);
    --km-text: var(--hd-ink);
    --km-text-muted: var(--hd-muted);
    --km-border: var(--hd-line);
    --km-bg-soft: var(--hd-bg-soft);
    --km-radius: var(--hd-radius-sm);
    --km-shadow: var(--hd-shadow);
    --km-shadow-hover: var(--hd-shadow-hover);

    /* Attendance: records, settings, shifts, shift detail, location detail */
    --att-primary: var(--hd-teal);
    --att-primary-dark: var(--hd-teal-dark);
    --att-soft: var(--hd-teal-soft);
    --att-text: var(--hd-ink);
    --att-muted: var(--hd-muted);
    --att-border: var(--hd-line);

    --shift-primary: var(--hd-teal);
    --shift-primary-dark: var(--hd-teal-dark);
    --shift-soft: var(--hd-teal-soft);
    --shift-text: var(--hd-ink);
    --shift-muted: var(--hd-muted);
    --shift-border: var(--hd-line);

    --detail-primary: var(--hd-teal);
    --detail-primary-dark: var(--hd-teal-dark);
    --detail-soft: var(--hd-teal-soft);
    --detail-text: var(--hd-ink);
    --detail-muted: var(--hd-muted);
    --detail-border: var(--hd-line);

    --loc-primary: var(--hd-teal);
    --loc-primary-dark: var(--hd-teal-dark);
    --loc-soft: var(--hd-teal-soft);
    --loc-text: var(--hd-ink);
    --loc-muted: var(--hd-muted);
    --loc-border: var(--hd-line);

    /* Business trips */
    --primary-teal: var(--hd-teal);
    --secondary-teal: #57bbb4;
    --dark-teal: var(--hd-teal-dark);
    --light-teal: #eaf8f7;
    --lighter-teal: #f4fbfa;
    --border-teal: #bde5e2;
    --text-dark: var(--hd-ink);
    --text-muted: var(--hd-muted);
}
