/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #ffffff;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Nuances: Subtle blue pattern */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(37, 99, 235, 0.04) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Login Card Container */
.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-container {
    background-color: #ffffff;
    border: 1px id="login-card-border" solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.05),
        0 8px 10px -6px rgba(59, 130, 246, 0.05),
        0 0 1px 1px rgba(59, 130, 246, 0.02);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top Accent Line (Blue Gradient) */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

/* Logo Area */
.logo-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.logo-badge svg {
    width: 32px;
    height: 32px;
}

/* Header Typography */
.header-text {
    text-align: center;
}

.header-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.header-text p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* Form Styles */
#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* Input Fields Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 46px !important;
    font-size: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

/* Focus and hover states */
.input-wrapper input:hover {
    border-color: #94a3b8;
}

.input-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.input-wrapper input:focus+.input-icon {
    color: #3b82f6;
}

/* PIN Helper text */
.helper-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* View/Hide Password Toggle */
.toggle-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color 0.2s ease;
}

.toggle-btn:hover {
    color: #475569;
}

.toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Utilities Row */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 24px;
    cursor: pointer;
    color: #475569;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input~.checkmark {
    border-color: #94a3b8;
}

.checkbox-container input:checked~.checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Action Button */
.btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Loader Animation */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

/* Alert Box */
.alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: fadeIn 0.4s ease;
    transition: all 0.35s ease;
}

.alert-box.success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-box.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-box.hide {
    display: none !important;
}

/* Footer Inside Form Card */
.login-footer {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 10px;
}

/* Utilities classes */
.hide {
    display: none !important;
}

/* Keyframes */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustment for small screens */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 20px;
        border-radius: 12px;
    }
}

/* Register Prompt below login form */
.register-prompt {
    text-align: center;
    font-size: 13.5px;
    color: #64748b;
    margin-top: 10px;
}

.register-prompt a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.register-prompt a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Select styling to match input fields */
.input-wrapper select {
    width: 100%;
    padding: 12px 14px 12px 46px;
    font-size: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    /* remove default arrow */
    cursor: pointer;
}

.input-wrapper select:hover {
    border-color: #94a3b8;
}

.input-wrapper select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Add custom arrow for select */
.input-wrapper::after {
    /* For select wrappers specifically */
    content: '';
    position: absolute;
    right: 16px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #94a3b8;
    pointer-events: none;
}

/* Ensure only select wrappers have the arrow */
.input-wrapper:has(input)::after {
    display: none;
}

/* Database Status Badge */
.db-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    align-self: center;
}

.db-status-badge .status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #cbd5e1;
    display: inline-block;
}

.db-status-badge.connected {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.db-status-badge.connected .status-indicator {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.db-status-badge.disconnected {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

.db-status-badge.disconnected .status-indicator {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Flex layout adjust for footer including status badge */
.login-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Split Layout for Registration Container */
.register-wrapper {
    max-width: 800px;
    width: 100%;
}

.register-split-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 32px;
    max-width: 800px;
    width: 100%;
}

.register-left-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #e2e8f0;
    padding-right: 32px;
}

.register-left-panel .logo-area {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.register-left-panel .header-text {
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 24px;
}

.register-left-panel .header-text h1 {
    font-size: 24px;
    color: #2563eb;
    margin-bottom: 6px;
}

.register-left-panel .header-text h2 {
    font-size: 18px;
    color: #0f172a;
    font-weight: 600;
    margin-bottom: 8px;
}

.register-left-panel .register-prompt {
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 13.5px;
}

.register-left-panel .login-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    width: 100%;
    align-items: flex-start;
}

.register-left-panel .db-status-badge {
    margin-top: 10px;
    align-self: flex-start;
}

.register-right-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.register-right-panel #register-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Responsive collapse on tablet/mobile screens */
@media (max-width: 768px) {
    .register-split-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 24px;
        max-width: 440px;
    }

    .register-left-panel {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 20px;
    }

    .register-left-panel .header-text {
        text-align: center;
        align-items: center;
    }

    .register-left-panel .logo-area {
        justify-content: center;
    }

    .register-left-panel .register-prompt {
        text-align: center;
    }

    .register-left-panel .login-footer {
        align-items: center;
    }

    .register-left-panel .db-status-badge {
        align-self: center;
    }
}

/* ==========================================
   DASHBOARD LAYOUT STYLES
   ========================================== */

.dashboard-body {
    background-color: #f8fafc;
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    display: block;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Navigation */
.dashboard-sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand .logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.sidebar-brand .logo-badge svg {
    width: 24px;
    height: 24px;
}

.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.menu-item.active {
    background-color: #eff6ff;
    color: #2563eb;
}

.menu-icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.logout-icon {
    width: 18px;
    height: 18px;
}

/* Main Content Wrapper */
.dashboard-main-content {
    flex-grow: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
}

/* Top Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}

.header-intro h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.header-intro p {
    font-size: 14px;
    color: #64748b;
}

.header-profile-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-profile-section .db-status-badge {
    margin: 0;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 1.5px solid #dbeafe;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

.profile-role {
    font-size: 11px;
    color: #64748b;
}

/* Dashboard Grid Panels */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.dashboard-card.span-2 {
    grid-column: span 2;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.card-header h3 svg.header-icon {
    width: 18px;
    height: 18px;
    color: #2563eb;
}

.card-header p {
    font-size: 13px;
    color: #64748b;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background-color: #ffd8a8;
    color: #d9480f;
}

/* Quick Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.action-btn-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.action-btn-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.bg-blue {
    background-color: #eff6ff;
    color: #2563eb;
}

.bg-cyan {
    background-color: #ecfeff;
    color: #0891b2;
}

.bg-indigo {
    background-color: #eef2ff;
    color: #4f46e5;
}

.bg-emerald {
    background-color: #ecfdf5;
    color: #059669;
}

.action-text h4 {
    font-size: 14px;
    font-weight: 650;
    color: #0f172a;
    margin-bottom: 2px;
}

.action-text p {
    font-size: 11px;
    color: #64748b;
    margin: 0;
}

/* Queue List Content Wrapper */
.queue-content-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background-color: #fafafa;
}

.placeholder-container {
    text-align: center;
    padding: 24px;
    max-width: 320px;
}

.placeholder-illustration {
    margin-bottom: 12px;
    color: #94a3b8;
}

.placeholder-illustration svg {
    width: 48px;
    height: 48px;
}

.placeholder-container h4 {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.placeholder-container p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

/* System Info / General Info Panels */
.info-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.info-block-item {
    border-left: 3px solid #2563eb;
    padding-left: 14px;
}

.info-block-item h5 {
    font-size: 13.5px;
    font-weight: 650;
    color: #0f172a;
    margin-bottom: 6px;
}

.info-block-item p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

/* Responsive Dashboard Collapse */
@media (max-width: 1024px) {
    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        position: relative;
    }

    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 16px;
    }

    .sidebar-footer {
        display: none;
        /* Hide or relocate logout link */
    }

    .dashboard-main-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card.span-2 {
        grid-column: span 1;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-profile-section {
        width: 100%;
        justify-content: space-between;
    }

    .info-content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================================================
   Form Pendaftaran Lansia Baru
   ========================================================================== */
.form-lansia-card {
    padding: 30px;
    max-width: 900px;
    margin: 0 auto 30px auto;
}

/* Forms */
fieldset[disabled] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

fieldset[disabled] * {
    cursor: not-allowed !important;
}

fieldset[disabled] input,
fieldset[disabled] select,
fieldset[disabled] textarea {
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
}

.form-grid-lansia {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.form-section-title {
    grid-column: span 2;
    margin-top: 15px;
    margin-bottom: 5px;
}

.form-section-title h3 {
    font-size: 15px;
    font-weight: 650;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-section-title h3 svg.header-icon {
    width: 18px;
    height: 18px;
    color: #2563eb;
}

.form-section-title hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group label .calc-badge {
    background-color: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    background-color: #fff;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn-submit-form {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 650;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 42px;
    transition: all 0.2s ease;
}

.btn-submit-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-submit-form:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel-form {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    box-sizing: border-box;
}

.btn-cancel-form:hover {
    color: #1e293b;
    background-color: #f8fafc;
    border-color: #94a3b8;
}

/* Alert Box di halaman Form */
.alert-box {
    grid-column: span 2;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.alert-box.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-box.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-box.hide {
    display: none !important;
}

/* Responsive grid for Form */
@media (max-width: 768px) {
    .form-grid-lansia {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-section-title,
    .form-group.span-2,
    .form-actions.span-2,
    .alert-box {
        grid-column: span 1;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .btn-submit-form,
    .btn-cancel-form {
        width: 100%;
    }
}

/* Datatable styles for Data Lansia */
.table-header-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.table-title-area h3 {
    font-size: 18px;
    font-weight: 650;
    color: #0f172a;
    margin-bottom: 4px;
}

.table-title-area p {
    font-size: 13px;
    color: #64748b;
}

.search-wrapper {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    font-size: 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.search-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-icon-inside {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-icon-inside svg {
    width: 18px;
    height: 18px;
}

.table-container-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.data-table-lansia {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: #ffffff;
}

.data-table-lansia th {
    background-color: #f8fafc;
    color: #475569;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1.5px solid #e2e8f0;
    user-select: none;
}

.data-table-lansia td {
    padding: 14px 16px;
    font-size: 13.5px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table-lansia tbody tr:hover {
    background-color: #f8fafc;
}

/* Screening badges */
.badge-screening {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-screening.sudah {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-screening.belum {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.action-row-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    min-width: 180px;
}

.btn-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.btn-row-action.detail {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-row-action.detail:hover {
    background-color: #e2e8f0;
}

.btn-row-action.screening {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-row-action.screening:hover {
    background-color: #dbeafe;
}

/* Modal styles for lansia detail popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: #ffffff;
    max-width: 600px;
    width: 90%;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    color: #ffffff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.btn-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.btn-modal-close:hover {
    opacity: 1;
}

.btn-modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item-col {
    display: flex;
    flex-direction: column;
}

.detail-item-col.full {
    grid-column: span 2;
}

.detail-label {
    font-size: 11.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-val {
    font-size: 14px;
    font-weight: 550;
    color: #1e293b;
}

.modal-section-divider {
    grid-column: span 2;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 650;
    color: #1e3a8a;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 6px;
}

/* ==========================================
   Antrean Skrining Lansia Styles
   ========================================== */
.queue-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    align-self: stretch;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.queue-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

.queue-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid #dbeafe;
}

.queue-avatar.female {
    background-color: #fdf2f8;
    color: #db2777;
    border-color: #fce7f3;
}

.queue-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.queue-name {
    font-size: 13.5px;
    font-weight: 650;
    color: #0f172a;
}

.queue-meta {
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.queue-meta .dot {
    width: 4px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 50%;
    display: inline-block;
}

.queue-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-queue-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-queue-action svg {
    width: 14px;
    height: 14px;
}

.btn-queue-action.start {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-queue-action.start:hover {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-queue-action.start.alt {
    background-color: #fdf4ff;
    color: #c026d3;
    border-color: #fae8ff;
}

.btn-queue-action.start.alt:hover {
    background-color: #c026d3;
    color: #ffffff;
    border-color: #c026d3;
}

.btn-queue-action.done {
    background-color: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.btn-queue-action.done:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}

.btn-queue-action.cancel {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fca5a5;
}

.btn-queue-action.cancel:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.queue-content-wrapper.has-items {
    align-items: stretch;
    justify-content: flex-start;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* Screening History Cards */
.history-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.history-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 12px -2px rgba(50, 50, 93, 0.08), 0 3px 6px -3px rgba(0, 0, 0, 0.08);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f1f5f9;
}

.history-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.history-metric-box {
    background-color: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    border: 1.1px solid #f1f5f9;
}

.history-metric-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.history-metric-value {
    font-weight: 700;
    color: #334155;
    font-size: 13.5px;
}

/* SUS Style Layout */
.sus-question-block {
    margin-bottom: 64px;
    background: transparent;
    padding: 0 10px;
}

.sus-question-text {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 32px;
    font-weight: 500;
}

.sus-options-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.sus-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    /* evenly distribute */
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.sus-option:hover {
    background-color: #f1f5f9;
}

.sus-option:active {
    transform: scale(0.98);
}

.sus-option input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    outline: none;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 2px;
    /* align with first line of text */
    transition: all 0.2s ease;
}

.sus-option input[type="radio"]:checked {
    border-color: #2563eb;
    background-color: transparent;
    position: relative;
    box-shadow: 0 0 0 4px #eff6ff;
}

.sus-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #2563eb;
    border-radius: 50%;
}

.sus-option-label {
    font-size: 14px;
    color: #475569;
    line-height: 1.4;
    user-select: none;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.sus-option input[type="radio"]:checked+.sus-option-label {
    font-weight: 600;
    color: #1e293b;
}

/* Kuesioner Banner Headers */
.kuesioner-section-header {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 6px solid #2563eb;
    margin: 64px -24px 40px -24px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.kuesioner-section-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.kuesioner-section-header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
/* Scrollable Feed for History Cards */
.history-feed { display: flex; flex-direction: column; gap: 12px; max-height: 480px; overflow-y: auto; padding-right: 6px; }
.history-feed::-webkit-scrollbar { width: 5px; }
.history-feed::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
