/* =====================================================
   ABSENSI RS - Hospital Attendance System
   Tema: Modern Hospital (Biru/Hijau)
   ===================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --primary: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --bg-dark: #020617;
    --sidebar-bg: #0f172a;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient-bg: #f1f5f9;
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(13, 110, 253, 0.3);
    border-radius: 3px;
}

/* ---------- Login Page ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-floating-custom {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-floating-custom .form-control {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem 0.85rem 3rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.form-floating-custom .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    background: white;
}

.form-floating-custom .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    transition: var(--transition);
}

.form-floating-custom .form-control:focus+.input-icon,
.form-floating-custom .form-control:focus~.input-icon {
    color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.35);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

/* ---------- Login Clock Widget ---------- */
.login-clock-widget {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.login-clock-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

#login-clock-time {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--sidebar-bg);
    letter-spacing: 1px;
}

.login-tz-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.login-clock-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-tz-selector {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #cbd5e1;
}

.login-tz-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    display: block;
    margin-bottom: 0.5rem;
}

.login-tz-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.tz-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    transition: var(--transition);
}

.tz-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tz-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.login-tz-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ---------- Navbar (Top bar inside content) ---------- */
.navbar {
    background-color: var(--bg-dark) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.navbar #sidebarCollapse {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

.navbar .badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}


.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: #1e293b !important;
    font-size: 1.1rem;
}

.navbar-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.nav-link-custom {
    color: #475569 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    color: var(--primary) !important;
    background: rgba(13, 110, 253, 0.08);
}

.btn-logout {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    border: none;
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    color: white;
}

/* ---------- Main Content ---------- */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 70px);
}

/* ---------- Cards ---------- */
.card-glass {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-glass:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ---------- Welcome Card ---------- */
.welcome-card {
    background: var(--gradient-hero);
    border-radius: var(--radius);
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.welcome-card::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.welcome-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -30px;
    right: 60px;
}

.welcome-card h2 {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.welcome-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

/* ---------- Status Cards ---------- */
.status-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: white;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.status-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.status-icon.apel {
    background: rgba(13, 202, 240, 0.15);
    color: #0891b2;
}

.status-icon.masuk {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.status-icon.pulang {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.status-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-weight: 600;
    font-size: 1rem;
}

/* ---------- Badges ---------- */
.badge-role {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-militer {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
}

.badge-pns {
    background: linear-gradient(135deg, #065f46, #10b981);
    color: white;
}

.badge-p3k {
    background: linear-gradient(135deg, #9f1239, #f43f5e);
    color: white;
}

.badge-honor {
    background: linear-gradient(135deg, #92400e, #f59e0b);
    color: white;
}

.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #b45309;
}

.badge-info {
    background: rgba(13, 202, 240, 0.15);
    color: #0891b2;
}

/* ---------- Attendance Buttons ---------- */
.btn-absen {
    width: 100%;
    padding: 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-absen i {
    font-size: 1.3rem;
}

.btn-absen-apel {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
}

.btn-absen-masuk {
    background: var(--gradient-secondary);
    color: white;
}

.btn-absen-pulang {
    background: var(--gradient-primary);
    color: white;
}

.btn-absen:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-absen:active:not(:disabled) {
    transform: translateY(0);
}

.btn-absen:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(40%);
}

.btn-absen.done {
    background: linear-gradient(135deg, #64748b, #94a3b8) !important;
    pointer-events: none;
}

/* ---------- Shift Selector ---------- */
.shift-selector {
    padding: 1.25rem;
    background: white;
    border-radius: var(--radius);
    border: 2px solid #e2e8f0;
}

.shift-selector select {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.shift-selector select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* ---------- Clock ---------- */
.clock-display {
    background: var(--gradient-hero);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* ---------- Alert Notifications ---------- */
.alert-custom {
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-warning-custom {
    background: rgba(255, 193, 7, 0.12);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info-custom {
    background: rgba(13, 202, 240, 0.12);
    color: #0e7490;
    border-left: 4px solid #06b6d4;
}

.alert-success-custom {
    background: rgba(25, 135, 84, 0.12);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error-custom {
    background: rgba(220, 53, 69, 0.12);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ---------- History Table ---------- */
.table-custom {
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
}

.table-custom thead th {
    background: var(--gradient-hero);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.table-custom tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    font-size: 0.9rem;
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background: rgba(13, 110, 253, 0.03);
}

/* ---------- Spin Loader ---------- */
.spinner-btn {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-absen.loading .spinner-btn {
    display: inline-block;
}

.btn-absen.loading .btn-text {
    display: none;
}

/* ---------- Page Heading ---------- */
.page-heading {
    margin-bottom: 1.5rem;
}

.page-heading h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

.page-heading p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ---------- Sidebar Layout ---------- */
.wrapper {
    display: flex;
    width: 100%;
}

#sidebar {
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    transition: var(--transition);
    z-index: 1000;
}

#sidebar.active {
    margin-left: -280px;
}

#content {
    width: calc(100% - 280px);
    margin-left: 280px;
    transition: var(--transition);
}

#content.active {
    width: 100%;
    margin-left: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-menu {
    padding: 1.5rem 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    padding: 0.25rem 1rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    gap: 0.75rem;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-panel {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 992px) {
    #sidebar {
        margin-left: -280px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        width: 100%;
        margin-left: 0;
    }

    #content.active {
        margin-left: 280px;
    }
}


/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .welcome-card {
        padding: 1.5rem;
    }

    .welcome-card h2 {
        font-size: 1.25rem;
    }

    .clock-time {
        font-size: 2rem;
    }

    .navbar-brand-custom {
        font-size: 0.95rem;
    }
}

/* ---------- Animation Utilities ---------- */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* ---------- Pulse effect for active buttons ---------- */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.btn-absen:not(:disabled):not(.done) {
    animation: pulse 2.5s infinite;
}

.btn-absen-apel:not(:disabled):not(.done) {
    animation: pulse-cyan 2.5s infinite;
}

@keyframes pulse-cyan {
    0% {
        box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(8, 145, 178, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(8, 145, 178, 0);
    }
}

.btn-absen-masuk:not(:disabled):not(.done) {
    animation: pulse-green 2.5s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(25, 135, 84, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}