/* Modal Overlay - BASE (WAJIB ADA!) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--white);
    border-radius: 1rem;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Mobile-First Layout */

.mobile-view {
    background: #F9FAFB;
    min-height: 100vh;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #FEF3C7 0%, #FBBF24 100%);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.login-card {
    background: var(--white);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 2rem;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-card > p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.btn-toggle-password {
    position: absolute;
    right: 1rem;
    bottom: 0.875rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
}

.btn-toggle-password:hover {
    opacity: 1;
}

.btn-login {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.app-footer {
    text-align: center;
    color: var(--text);
    font-size: 0.75rem;
    line-height: 1.6;
}

/* Absen Screen */
.app-header {
    background: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.brand-logo {
    font-size: 1.5rem;
}

.brand-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.125rem;
}

.btn-logout-small {
    background: #FEE2E2;
    color: var(--danger);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    cursor: pointer;
}

.absen-main {
    padding: 1.5rem;
    padding-bottom: 6rem;
}

/* Greeting Card */
.greeting-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 1.25rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.greeting-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.quote-box {
    background: rgba(255,255,255,0.15);
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--white);
}

.quote-box p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.quote-box small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Time Section */
.current-time-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.current-time-card label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.time-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.5rem 0;
    font-variant-numeric: tabular-nums;
}

.shift-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--secondary);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.shift-icon {
    font-size: 1.125rem;
}

#shift-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-change-shift {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

/* Main Absen Button */
.btn-absen-main {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1.25rem;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transition: all 0.2s;
}

.btn-absen-main:active {
    transform: scale(0.98);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-mini-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    gap: 1rem;
}

.stat-mini-card .stat-icon {
    font-size: 2rem;
}

.stat-mini-card label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.375rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-mini-card small {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* History Section */
.history-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-filter {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.history-table-container {
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background: #F9FAFB;
}

.history-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.on-time {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.late {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.absent {
    background: #E5E7EB;
    color: #374151;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link.active {
    color: var(--primary);
    background: var(--secondary);
}

.nav-icon {
    font-size: 1.5rem;
}

/* Modals */
.shift-modal-content,
.success-modal-content,
.missed-modal-content {
    max-width: 400px;
    padding: 2rem;
    border-radius: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close-modal {
    background: #F3F4F6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.shift-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.shift-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.shift-option:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.shift-option.selected {
    border-color: var(--primary);
    background: var(--secondary);
}

.shift-option .shift-icon {
    font-size: 2rem;
}

.shift-details {
    flex: 1;
}

.shift-details h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.shift-details p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.shift-radio {
    font-size: 1.5rem;
    color: var(--border);
}

.shift-option.selected .shift-radio {
    color: var(--primary);
}

.btn-confirm-shift,
.btn-continue,
.btn-detail {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-shift,
.btn-continue {
    background: var(--primary);
    color: var(--white);
    margin-bottom: 0.75rem;
}

.btn-detail {
    background: #F3F4F6;
    color: var(--text);
}

/* Success Modal */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

.success-icon.late {
    background: var(--danger);
}

.success-modal-content h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.success-modal-content > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.success-quote {
    background: #F9FAFB;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success-quote p {
    font-style: italic;
    font-size: 0.875rem;
    color: var(--text);
}

/* Missed Modal */
.missed-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
}

.missed-modal-content h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.missed-modal-content > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.missed-subtitle {
    text-align: center;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.missed-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-missed {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-missed:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.btn-missed.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-missed.btn-danger:hover {
    background: #FEE2E2;
}

/* Absen Button Disabled State */
.btn-absen-main:disabled {
    background: #9CA3AF !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
}

.btn-absen-main:disabled:active {
    transform: none !important;
}