@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --primary: #009688;
    --primary-dark: #00796b;
    --primary-darker: #004d40;
    --primary-light: #b2dfdb;
    --primary-soft: #e0f2f1;
    --accent: #ffc107;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --text-light: #f5f5f5;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --primary-shadow: rgba(0, 77, 64, 0.15);
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    margin: 0;
    overflow-x: hidden;
    color: var(--text-dark);
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.sidebar-header img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #ffffff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-header .main-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.sidebar-header .sub-title {
    font-size: 0.55rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

.sidebar-menu {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 25px 5px;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 25px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border-left: 4px solid transparent;
    font-size: 0.8rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--accent);
}

.nav-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5);
}

.nav-item i {
    width: 25px;
    font-size: 0.9rem;
}

/* Submenu Styles */
.nav-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 25px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-group:hover,
.nav-group.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-group-left {
    display: flex;
    align-items: center;
}

.nav-group-left i {
    width: 25px;
    font-size: 0.9rem;
}

.nav-toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-group.expanded .nav-toggle-icon {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    background: rgba(0, 0, 0, 0.15);
}

.nav-submenu.show {
    display: block;
}

.nav-submenu .nav-item {
    padding: 8px 25px 8px 50px;
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background: var(--bg-light);
    position: relative;
}

/* Top Header */
.top-header {
    background: var(--white);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid #edf2f2;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-page-info {
    line-height: 1.2;
}

.header-quote {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-style: italic;
    color: #00796b;
    max-width: 400px;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}

@media (max-width: 1200px) {
    .header-quote {
        display: none;
    }
}

.header-date {
    font-size: 0.72rem;
    color: #888;
    font-weight: 500;
}

.header-clock {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* --- PAGE STRUCTURE --- */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.greeting-text {
    font-size: 0.95rem;
    color: #666;
}

/* Card & Layout Utilities */
.dashboard-flex-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f0f4f3;
}

.card-title-sm {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 0.95rem;
    font-weight: 600;
}

.flex-2 {
    flex: 2;
    min-width: 300px;
}

.flex-1 {
    flex: 1;
    min-width: 250px;
}

.sub-header-flex {
    margin-bottom: 10px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #444;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile:hover {
    background: #f8f9fa;
}

.user-profile-info {
    text-align: right;
    line-height: 1.3;
    margin-right: 8px;
}

.user-name-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
}

.user-role-label {
    font-size: 0.62rem;
    color: #777;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.user-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0f2f1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid white;
}

/* Profile Dropdown */
#profile-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eef2f1;
    z-index: 100;
}

.profile-menu-header {
    padding: 15px;
    background: #f8faf9;
    border-bottom: 1px solid #eef2f1;
    text-align: center;
}

.profile-menu-header .user-name-label {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.profile-menu-header .user-role-label {
    color: #888;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#profile-menu.show {
    display: flex;
}

.menu-item {
    padding: 10px 15px;
    font-size: 0.75rem;
    color: #444;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f5f8f7;
}

.menu-item:hover {
    background: #f1f8f7;
    color: var(--primary);
}

.menu-item i {
    width: 20px;
    font-size: 0.8rem;
    margin-right: 8px;
    color: #889998;
}

.menu-item.logout {
    color: #d32f2f;
}

.menu-item.logout i {
    color: #d32f2f;
}

/* Notification Toast (Premium Style) */
.toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 14px 22px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    min-width: 280px;
    border-left: 6px solid;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: auto;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

.toast-error {
    border-color: #ef5350;
    color: #c62828;
}

.toast-success {
    border-color: #4caf50;
    color: #2e7d32;
}

.toast-info {
    border-color: #2196f3;
    color: #1565c0;
}

.toast-warning {
    border-color: #ff9800;
    color: #e65100;
}

/* Content Body Wrapper */
.content-body {
    padding: 30px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.text-capitalize {
    text-transform: capitalize;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Kustom Alert Danger Style */
.modal-danger .modal-header {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

.modal-danger .btn-save {
    background: #e53935;
}

.modal-danger .btn-save:hover {
    background: #c62828;
}

/* Loading Overlay (Unified for Login & Dashboard) */
.loading-overlay,
#loading-overlay,
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #b2dfdb;
    border-top: 4px solid #009688;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 15px;
    color: #00796b;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- DASHBOARD & MASTER DATA SPECIFIC CSS --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
}

.stat-info p {
    margin: 0;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th,
.custom-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.75rem;
}

.custom-table th {
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
}

.custom-table tr:hover {
    background: #f1f1f1;
}

/* Tabs for Master Data */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    overflow-x: auto;
}

.tab-btn {
    padding: 6px 12px;
    border: none;
    background: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e0f2f1;
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.3);
}

.tab-content,
.kamus-tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-btn {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.75rem;
    margin-right: 5px;
}

.btn-edit {
    background: #ffb74d;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: #ffa726;
}

.btn-delete {
    background: #e53935 !important;
    color: #ffffff !important;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #c62828 !important;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.35);
}

.btn-view {
    background: var(--primary) !important;
    color: #ffffff !important;
    transition: all 0.2s ease;
}

.btn-view:hover {
    background: var(--primary-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 150, 136, 0.35);
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.bg-green {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.bg-red {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.bg-blue {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.bg-orange {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.bg-gray {
    background: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Access Grid */
.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.access-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.access-item:hover {
    border-color: var(--primary-light);
    background: #fbfdfd;
}

.access-icon {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.tab-item {
    cursor: pointer;
    padding: 12px 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.access-info {
    flex: 1;
}

.access-info h6 {
    margin: 0 0 5px;
    font-size: 0.75rem;
    color: #333;
    font-weight: 700;
}

.role-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.role-checkbox {
    display: none;
}

.role-label {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.role-checkbox:checked+.role-label {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 150, 136, 0.2);
}

.role-label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.section-divider {
    margin: 25px 0 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

#confirmModal {
    z-index: 9999 !important;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalFadeIn {
    from {
        transform: translateY(15px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 12px 18px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
    font-size: 0.9rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-body {
    padding: 15px 18px;
    overflow-y: auto;
}

.modal-footer {
    padding: 12px 18px;
    background: #f9f9f9;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Modal Tab Navigation (SIMAKU Theme) */
.tab-nav-container {
    display: flex;
    background: #f1f8f7;
    border-bottom: 1px solid #b2dfdb;
    padding: 10px 18px;
    gap: 10px;
    align-items: center;
}

.tab-nav-btn {
    padding: 8px 18px;
    background: #ffffff;
    border: 1px solid #b2dfdb;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.tab-nav-btn:hover {
    background: #e0f2f1;
    color: var(--primary-darker);
    border-color: var(--primary);
}

.tab-nav-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 3px 8px rgba(0, 150, 136, 0.3);
}

.tab-nav-btn i {
    font-size: 0.82rem;
}

/* Tracking Stepper */
.tracking-stepper {
    position: relative;
    padding-left: 36px;
    margin: 15px 0 10px;
}

.tracking-stepper::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 14px;
    bottom: 24px;
    width: 2px;
    background: #e2e8f0;
}

.stepper-step {
    position: relative;
    margin-bottom: 20px;
}

.stepper-step:last-child {
    margin-bottom: 0;
}

.stepper-icon {
    position: absolute;
    left: -36px;
    top: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: white;
    border: 2px solid #cbd5e1;
    color: #94a3b8;
    z-index: 2;
    transition: all 0.2s ease;
}

.stepper-step.completed .stepper-icon {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
}

.stepper-step.active .stepper-icon {
    background: #e1f5fe;
    border-color: #0288d1;
    color: #0288d1;
    box-shadow: 0 0 0 4px rgba(2, 136, 209, 0.15);
}

.stepper-step.rejected .stepper-icon {
    background: #ffebee;
    border-color: #c62828;
    color: #c62828;
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.15);
}

.stepper-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.stepper-step.active .stepper-content {
    border-color: #90caf9;
    background: #fbfdff;
}

.stepper-step.rejected .stepper-content {
    border-color: #ef9a9a;
    background: #fffafa;
}

.stepper-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.stepper-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.stepper-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.stepper-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.stepper-badge.active {
    background: #e1f5fe;
    color: #0288d1;
}

.stepper-badge.rejected {
    background: #ffebee;
    color: #c62828;
}

.stepper-badge.pending {
    background: #f1f5f9;
    color: #64748b;
}

/* Detail Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
}

.form-control,
.search-input-responsive {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d2d6dc;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.78rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    background-color: #fff;
    color: var(--text-dark);
}

.form-control:focus,
.search-input-responsive:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.15);
}

/* Validasi Visual: Merah jika [required] dan masih kosong */
.form-control[required]:placeholder-shown {
    border-color: #ef5350 !important;
    background-color: #fffafa;
}

select.form-control[required]:invalid {
    border-color: #ef5350 !important;
    background-color: #fffafa;
}

.form-control[required]:not(:placeholder-shown):valid {
    border-color: #d2d6dc;
}

/* Button System */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary,
.btn-save {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 6px rgba(0, 150, 136, 0.2);
}

.btn-primary:hover,
.btn-save:hover {
    background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.3);
}

.btn-primary:active,
.btn-save:active {
    transform: scale(0.98);
}

.btn-cancel,
.btn-secondary {
    background: #f1f3f4;
    color: #4a5568;
    border: 1px solid #d2d6dc;
    padding: 8px 14px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
}

.btn-cancel:hover,
.btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
    border-color: #cbd5e0;
}

.btn-cancel:active,
.btn-secondary:active {
    transform: scale(0.98);
}

.btn-soft {
    background: #e0f2f1;
    color: var(--primary-dark);
    border: 1px solid #b2dfdb;
    padding: 8px 14px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
}

.btn-soft:hover {
    background: #b2dfdb;
    color: var(--primary-darker);
}

.btn-soft:active {
    transform: scale(0.98);
}

select.form-control,
.filter-bar select {
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    padding: 8px 12px;
    border: 1px solid #d2d6dc;
    border-radius: var(--radius-sm, 6px);
    background-color: #fff;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.form-control:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.15);
}

/* Account Tab Styling */
.account-tab-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
}

.account-sidebar {
    border-right: 1px solid #eee;
    padding-right: 20px;
}

/* --- MOBILE RESPONSIVE STYLES --- */

/* Hamburger Button (Mobile only) */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-dark);
    cursor: pointer;
    margin-right: 15px;
}

/* Sidebar Backdrop (Overlay) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .app-container {
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .main-content {
        margin-left: 0;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .top-header {
        padding: 10px 15px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .mobile-toggle {
        display: block;
    }

    .content-body {
        padding: 15px;
    }

    /* Stack flex containers on mobile */
    .flex-between-responsive {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    .flex-between-responsive>div {
        width: 100%;
    }

    .search-input-responsive {
        width: 100% !important;
    }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        margin-bottom: 15px;
        padding: 15px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Table horizontal scroll fix */
    .table-container {
        margin: 0 -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Action buttons wrapping */
    .action-group {
        flex-wrap: wrap;
        gap: 5px;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1rem;
    }

    .stat-info h3 {
        font-size: 1.2rem;
    }

    .top-header .brand-text {
        display: none;
        /* Hide brand text to save space if needed */
    }

    .user-profile .text-area {
        display: none;
    }

    .hide-mobile {
        display: none !important;
    }

    .content-body {
        padding: 10px !important;
    }

    /* --- TABLE TO CARDS TRANSFORMATION (MAXIMIZED) --- */
    .table-to-cards,
    .table-to-cards thead,
    .table-to-cards tbody,
    .table-to-cards tr,
    .table-to-cards td {
        display: block !important;
        width: 100% !important;
    }

    .table-to-cards thead {
        display: none !important;
    }

    .table-to-cards tr {
        margin-bottom: 12px !important;
        border: 1px solid #eef2f1 !important;
        border-radius: 10px !important;
        padding: 12px !important;
        background: #fff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    }

    .table-to-cards td {
        border: none !important;
        padding: 5px 0 !important;
    }

    /* Show hidden columns in card view */
    .table-to-cards .hide-mobile {
        display: block !important;
    }

    .table-to-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #99aab5;
        font-size: 0.6rem;
        text-transform: uppercase;
        display: block;
        margin-bottom: 1px;
    }

    /* First child (Employee Name) header style - Prominent */
    .table-to-cards td:first-child {
        border-bottom: 1px solid #f0f4f3 !important;
        padding-bottom: 8px !important;
        margin-bottom: 10px !important;
        background: #fbfdfc;
        margin: -12px -12px 10px -12px !important;
        padding: 12px !important;
        border-radius: 10px 10px 0 0;
    }

    .table-to-cards td:first-child::before {
        display: none;
    }

    /* Last child (Actions) style */
    .table-to-cards td:last-child {
        margin-top: 10px !important;
        padding-top: 10px !important;
        border-top: 1px dashed #eee !important;
        display: flex !important;
        justify-content: flex-end;
        gap: 8px;
    }

    .table-to-cards td:last-child::before {
        display: none;
    }
}

/* Base utilities (Must be at the bottom to override everything) */
.d-none-important {
    display: none !important;
}

/* Switch Toggle for Standard Form */
.switch-standard {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch-standard input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-standard {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 18px;
}

.slider-standard:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-standard input:checked+.slider-standard {
    background-color: var(--primary);
}

.switch-standard input:checked+.slider-standard:before {
    transform: translateX(16px);
}

/* ==========================================================================
   AUTHENTICATION & LOGIN PAGE
   ========================================================================== */
body.login-page {
    font-family: 'Poppins', sans-serif;
    background-color: #e0f2f1;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 150, 136, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 150, 136, 0.15) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23004d40' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
}

.login-card {
    background: var(--white);
    padding: 26px 30px;
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 10px 25px rgba(0, 77, 64, 0.1);
    width: 100%;
    max-width: 360px;
    text-align: center;
    border-top: 4px solid var(--primary);
    box-sizing: border-box;
}

.login-card .logo-placeholder {
    margin-bottom: 8px;
}

.login-card h2 {
    margin: 8px 0 3px;
    color: var(--primary-darker, #004d40);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.login-card p {
    color: var(--primary-dark);
    font-size: 0.8rem;
    margin-bottom: 18px;
}

.login-card .form-group {
    margin-bottom: 13px;
    text-align: left;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
}

.login-card .form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm, 6px);
    box-sizing: border-box;
    font-size: 0.86rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    font-family: 'Poppins', sans-serif;
    background: #fff;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.2);
}

.password-box {
    position: relative;
}

.password-box input {
    padding-right: 38px;
}

.password-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--primary-dark);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.password-box i:hover {
    color: var(--primary);
}

.btn-google {
    background: white;
    color: #444;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 9px 12px;
    font-size: 0.84rem;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-google img {
    width: 18px;
    height: 18px;
}

.separator {
    margin: 13px 0;
    position: relative;
    text-align: center;
}

.separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #eee;
    z-index: 1;
}

.separator span {
    background: white;
    padding: 0 12px;
    color: #888;
    font-size: 0.74rem;
    position: relative;
    z-index: 2;
}

.cta-wa {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--primary-dark);
}

.cta-wa a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.cta-wa a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}