
/* =========================================================
   HRD EXPRESS BAHARI
   Main stylesheet
   Theme: Dark Navy Corporate
   File: public/css/app.css
   ========================================================= */

:root {
    --bg: #081426;
    --sidebar: #0d1b30;
    --panel: #101f34;
    --panel-hover: #172a43;
    --border: #263850;

    --text: #e8eef8;
    --text-secondary: #c4d0e0;
    --muted: #91a2ba;

    --accent: #54b8ff;
    --accent-dark: #1766a5;

    --success: #4bd5a1;
    --success-bg: #12352f;

    --warning: #ffc16b;
    --warning-bg: #392b20;

    --danger: #ff7b86;
    --danger-bg: #3b202b;

    --radius: 12px;
    --radius-small: 7px;

    --sidebar-width: 250px;
    --transition: 0.2s ease;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    display: flex;
    flex-direction: column;

    padding: 28px 18px 18px;

    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.main-area {
    display: flex;
    flex: 1;
    flex-direction: column;

    min-width: 0;
    min-height: 100vh;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;

    padding: 0 2px;

    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.3;
}

.brand-main {
    color: var(--text);
}

.brand-accent {
    color: var(--accent);
}

.brand small {
    display: block;
    width: 100%;

    margin-top: 4px;

    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.nav-label {
    margin: 38px 0 12px 10px;

    color: #7285a1;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.nav-menu {
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 42px;

    padding: 11px 12px;

    border-radius: 8px;

    color: #9aabc2;
    font-size: 13px;

    transition:
        background var(--transition),
        color var(--transition);
}

.nav-link span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    flex: 0 0 20px;

    font-size: 17px;
}

.nav-link:hover {
    color: var(--text);
    background: var(--panel-hover);
}

.nav-link.active {
    color: #ffffff;
    background: #193b60;
    box-shadow: inset 3px 0 var(--accent);
}

.nav-link.disabled {
    color: #71829a;
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================================
   SIDEBAR FOOTER
   ========================================================= */

.sidebar-footer {
    margin-top: auto;
    padding: 16px 8px 0;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 12px;
}

.sidebar-footer small {
    display: block;
    margin: 6px 0 0 16px;

    color: #7285a1;
    font-size: 11px;
}

.status-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 6px;

    background: var(--success);
    border-radius: 50%;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 86px;
    padding: 18px 32px;

    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
}

.topbar-subtitle {
    margin-top: 6px;

    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   USER CHIP
   ========================================================= */

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 12px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.user-avatar {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    border-radius: 9px;

    background: #193b60;
    color: var(--accent);

    font-size: 14px;
    font-weight: 700;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.user-chip small {
    margin-top: 4px;

    color: var(--muted);
    font-size: 11px;
}

/* =========================================================
   PAGE CONTENT
   ========================================================= */

.page-content {
    flex: 1;
    min-width: 0;

    padding: 30px 32px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0 0 7px;

    color: var(--text);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.4;
}

.page-heading p {
    margin: 0;
}

.muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

/* =========================================================
   PANELS / CARDS
   ========================================================= */

.panel {
    margin-bottom: 22px;
    padding: 22px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel-title {
    margin: 0 0 6px;

    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.panel-description {
    margin: 0 0 20px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* Dashboard statistic cards */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    min-width: 0;
    padding: 22px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card-label {
    color: var(--muted);
    font-size: 12px;
}

.number {
    margin: 17px 0 8px;

    color: var(--text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
}

.accent {
    color: var(--accent);
}

.green {
    color: var(--success);
}

.orange {
    color: var(--warning);
}

/* =========================================================
   FORMS
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;

    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.form-control {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 42px;

    padding: 10px 12px;

    background: #0b192b;
    color: var(--text);

    border: 1px solid #30445e;
    border-radius: var(--radius-small);

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-control::placeholder {
    color: #71839d;
    opacity: 1;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(84 184 255 / 10%);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background: var(--panel);
    color: var(--text);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-top: 22px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 38px;
    padding: 9px 14px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;

    text-align: center;
    white-space: nowrap;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-dark);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #217bc0;
}

.btn-secondary {
    background: #1b2c43;
    color: var(--text-secondary);
    border-color: #354861;
}

.btn-secondary:hover:not(:disabled) {
    background: #263c58;
    color: #ffffff;
}

.btn-danger {
    background: var(--danger-bg);
    color: #ffb0b7;
    border-color: #63313e;
}

.btn-danger:hover:not(:disabled) {
    background: #542a36;
}

.btn-sm {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 11px;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;

    border-radius: 7px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;

    text-align: left;
}

.data-table th {
    padding: 14px 12px;

    background: #0d1b2e;
    color: var(--muted);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;

    white-space: nowrap;
}

.data-table td {
    padding: 14px 12px;

    color: #d5deeb;
    font-size: 12px;
    line-height: 1.6;

    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--panel-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table td strong {
    color: var(--text);
    font-weight: 600;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

/* =========================================================
   STATUS BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;

    white-space: nowrap;
}

.badge-active {
    background: #123b35;
    color: #6be2ba;
}

.badge-inactive {
    background: var(--warning-bg);
    color: var(--warning);
}

/* =========================================================
   ALERTS / NOTIFICATIONS
   ========================================================= */

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.7;
}

.alert-success {
    background: var(--success-bg);
    color: #8ce8c9;
    border-color: #225b4d;
}

.alert-error {
    background: var(--danger-bg);
    color: #ffb0b7;
    border-color: #63313e;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 34px 16px;

    color: var(--muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: 20px;

    color: var(--muted);
    font-size: 12px;
}

.pagination nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.pagination a,
.pagination span[aria-current="page"] span,
.pagination span[aria-disabled="true"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    min-height: 34px;

    padding: 6px 10px;

    background: var(--panel);
    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 6px;
}

.pagination a:hover {
    background: var(--panel-hover);
    color: var(--accent);
}

.pagination span[aria-current="page"] span {
    background: #193b60;
    color: #ffffff;
    border-color: #285681;
}

.pagination span[aria-disabled="true"] span {
    opacity: 0.5;
}

/* =========================================================
   FOOTER
   ========================================================= */

.page-footer {
    padding: 18px 32px;

    border-top: 1px solid var(--border);

    color: #7285a1;
    font-size: 11px;
    line-height: 1.6;
}

/* =========================================================
   DASHBOARD EMPTY AREA
   ========================================================= */

.empty {
    margin-top: 20px;
    padding: 24px;

    border: 1px dashed #344862;
    border-radius: 9px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* =========================================================
   RESPONSIVE: TABLET
   ========================================================= */

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 220px;
        flex-basis: 220px;
    }

    .page-content,
    .topbar {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* =========================================================
   RESPONSIVE: MOBILE
   ========================================================= */

@media (max-width: 650px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        padding: 18px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar .nav-label,
    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;

        margin-top: 18px;
    }

    .nav-link {
        width: auto;
        min-height: 34px;

        padding: 8px 10px;

        font-size: 11px;
    }

    .nav-link span {
        display: none;
    }

    .nav-link.active {
        box-shadow: inset 0 -2px var(--accent);
    }

    .main-area {
        min-height: auto;
    }

    .topbar {
        min-height: 72px;
        padding: 16px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .user-chip {
        display: none;
    }

    .page-content {
        padding: 22px 16px;
    }

    .page-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .page-heading h1 {
        font-size: 21px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        padding: 18px;
    }

    .number {
        font-size: 26px;
    }

    .panel {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group.full {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;
    }

    .form-actions .btn {
        flex: 1;
    }

    .data-table th,
    .data-table td {
        padding: 11px 10px;
    }

    .page-footer {
        padding: 16px;
    }
}

/* =========================================================
   RESPONSIVE: SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {
    .brand {
        font-size: 17px;
    }

    .nav-link {
        padding: 7px 8px;
        font-size: 10px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .page-content {
        padding: 18px 12px;
    }

    .panel {
        padding: 13px;
    }
}


/* Employee search form */

.search-form {
    margin-bottom: 20px;
}

.search-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-control .form-control {
    flex: 1;
    min-width: 180px;
}

@media (max-width: 650px) {
    .search-control {
        flex-wrap: wrap;
    }

    .search-control .form-control {
        flex-basis: 100%;
    }
}


/* =========================================================
   DASHBOARD HRD
   ========================================================= */

.welcome {
    margin-bottom: 25px;
}

.welcome h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
}

.section {
    margin-top: 25px;
    padding: 24px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.section h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.section .empty {
    margin-top: 20px;
}

@media (max-width: 650px) {
    .welcome h2 {
        font-size: 19px;
    }

    .section {
        padding: 16px;
    }
}


/* Tombol logout HRD */
.user-chip {
    gap: 10px;
}

.logout-form {
    margin-left: 8px;
}

.logout-button {
    padding: 8px 11px;
    border: 1px solid #344b67;
    border-radius: 6px;
    background: #172a42;
    color: #dbeafe;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.logout-button:hover {
    background: #713341;
    border-color: #a64c60;
}

@media (max-width: 650px) {
    .user-chip {
        flex-wrap: wrap;
    }

    .logout-form {
        margin-left: 0;
    }
}

