/* Tugaskuliahunpam - Modern & Minimalist Stylesheet */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #3b82f6;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --dark: #1e1b4b;
    --gray-bg: #f8f9fa;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--gray-bg);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* Sidebar General */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e1b4b 0%, #2e2a72 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar .sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 18px;
    margin: 4px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    color: #fff;
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--gray-bg);
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: none;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards Standard */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    background-color: #fff;
    margin-bottom: 1.5rem;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.15rem 1.5rem;
    font-weight: 600;
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Tables */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background-color: #f9fafb;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.9rem 1rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: #f8faff;
}

/* Custom Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Modern Badges */
.badge-status {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge-tepat {
    background-color: var(--success-light);
    color: #065f46;
}

.badge-terlambat {
    background-color: var(--danger-light);
    color: #991b1b;
}

.badge-belum {
    background-color: var(--warning-light);
    color: #92400e;
}

.badge-aktif {
    background-color: var(--primary-light);
    color: #3730a3;
}

/* Upload Area Component */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    padding: 2.25rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.upload-dropzone:hover, .upload-dropzone.dragover, .upload-dropzone:active {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-dropzone .upload-icon {
    font-size: 2.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* Form Styling */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
    color: #374151;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* =========================================================
   MOBILE & TABLET RESPONSIVE STYLING
   ========================================================= */

@media (max-width: 991.98px) {
    /* Main Content on Mobile */
    main {
        margin-left: 0 !important;
        padding: 1rem !important;
        padding-top: 4.75rem !important; /* Space for the sticky topbar */
        width: 100% !important;
        min-height: 100vh !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
        padding-top: 4.75rem !important;
    }

    /* Page Titles & Headers */
    h4.fw-bold {
        font-size: 1.25rem !important;
    }

    /* Welcome Banner on Mobile */
    .card-body h3 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    /* Stat Cards in 2 columns on Mobile */
    .stat-card .card-body {
        padding: 0.9rem !important;
        gap: 0.6rem !important;
    }
    .stat-card .stat-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.2rem !important;
        border-radius: 10px !important;
    }
    .stat-card .stat-number {
        font-size: 1.35rem !important;
    }
    .stat-card .stat-label {
        font-size: 0.72rem !important;
    }

    /* Cards general padding */
    .card-header {
        padding: 0.9rem 1rem !important;
    }
    .card-body {
        padding: 1rem !important;
    }

    /* Tables on Mobile */
    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
    }
    .table thead th {
        font-size: 0.72rem !important;
        padding: 0.65rem 0.75rem !important;
    }
    .table tbody td {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }

    /* Dropzone on Mobile */
    .upload-dropzone {
        padding: 1.75rem 0.75rem !important;
    }
    .upload-dropzone .upload-icon {
        font-size: 2.25rem !important;
    }

    /* Modal on Mobile */
    .modal-dialog {
        margin: 0.75rem;
    }

    /* Auth Cards on Mobile */
    .login-card, .register-card {
        padding: 2rem 1.25rem !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 575.98px) {
    /* Extra Small Devices (Phones < 576px) */
    body {
        font-size: 0.9rem;
    }

    main {
        padding: 0.75rem !important;
        padding-top: 4.5rem !important;
    }

    .card {
        border-radius: 10px;
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 0.85rem !important;
    }

    .card-body {
        padding: 0.85rem !important;
    }

    /* Stat Cards Extra Compact */
    .stat-card .card-body {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
    }
    .stat-card .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.05rem !important;
        border-radius: 8px !important;
    }
    .stat-card .stat-number {
        font-size: 1.2rem !important;
    }
    .stat-card .stat-label {
        font-size: 0.68rem !important;
        letter-spacing: 0.2px;
    }

    /* Buttons */
    .btn {
        font-size: 0.84rem;
        padding: 0.45rem 0.9rem;
    }

    .btn-sm {
        font-size: 0.78rem;
        padding: 0.3rem 0.55rem;
    }

    /* Form Inputs (Prevent iOS Safari auto-zoom by setting >= 16px) */
    .form-control, .form-select {
        font-size: 16px;
    }

    /* Pagination */
    .pagination {
        font-size: 0.8rem;
    }
    .pagination .page-link {
        padding: 0.25rem 0.5rem;
    }
}
