@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Reset & Base Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f1f5f9; /* Soft slate background */
    color: #0f172a; /* Dark slate text */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- Card Containers --- */
.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    padding: 2.5rem;
    width: 100%;
    border: 1px solid #e2e8f0;
}
.card-sm { max-width: 420px; }
.card-lg { max-width: 800px; }

/* --- Typography --- */
h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}
p.subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}
.text-danger { color: #dc2626; background: #fee2e2; padding: 10px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 15px;}
.text-success { color: #059669; background: #d1fae5; padding: 10px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 15px;}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}
label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
input[type="file"] {
    padding: 2rem;
    border: 2px dashed #cbd5e1;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.btn-danger { background: #fee2e2; color: #dc2626; padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-danger:hover { background: #fca5a5; color: #991b1b; }

/* --- Dashboard Specifics --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: #3b82f6;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.actions-grid.single-column {
    grid-template-columns: 1fr;
}

.action-card {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-card:hover {
    border-color: #2563eb;
    background: #f8fbff;
    transform: scale(1.02);
}

.action-card strong {
    display: block;
    font-size: 1.2rem;
    color: #0f172a;
    margin-top: 10px;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}
th {
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}
td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

/* --- Added Animations --- */
@keyframes highlight-flash {
    0% { background-color: #dbeafe; transform: scale(1.05); }
    100% { background-color: transparent; transform: scale(1); }
}

.flash-update {
    animation: highlight-flash 1s ease-out;
}

/* --- Archive Button Hover States --- */
.action-approve:hover { background-color: #d1fae5 !important; color: #059669 !important; }
.action-reject:hover { background-color: #fee2e2 !important; color: #dc2626 !important; }
.action-delete:hover { background-color: #fee2e2 !important; color: #dc2626 !important; }

/* =========================================
   DASHBOARD CSP-SAFE COMPONENT CLASSES
   ========================================= */

.dashboard-wrapper { background: transparent; box-shadow: none; border: none; }
.alert-danger { background: #fee2e2; color: #dc2626; padding: 1rem; border-radius: 12px; border: 1px solid #fecaca; margin-bottom: 1.5rem; text-align: center; font-weight: 600; }
.header-box { background: white; padding: 2rem; border-radius: 16px; border: 1px solid #e2e8f0; margin-bottom: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.header-title { display: flex; align-items: center; gap: 12px; margin: 0; }
.header-icon { background: #eff6ff; padding: 8px; border-radius: 10px; }
.header-subtitle { color: #64748b; margin-top: 5px; }
.text-dark { color: #0f172a; }

.stat-icon { font-size: 1.2rem; margin-bottom: 5px; }
.text-slate { color: #475569; }
.text-amber { color: #d97706; }
.text-emerald { color: #059669; }
.text-blue { color: #2563eb; }

.action-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 1.5rem; }
.icon-green { background: #dcfce7; }
.icon-yellow { background: #fef9c3; }
.action-desc { font-size: 0.85rem; color: #64748b; margin-top: 8px; }

.history-box { margin-top: 2rem; background: white; padding: 1.5rem; border-radius: 12px; border: 1px solid #e2e8f0; }
.history-title { margin-bottom: 1rem; color: #0f172a; font-size: 1.1rem; }
.history-table { width: 100%; text-align: left; border-collapse: collapse; }
.history-th { padding: 10px; border-bottom: 2px solid #e2e8f0; color: #64748b; }
.history-td { 
    padding: 10px; 
    border-bottom: 1px solid #f1f5f9; 
    
    /* NEW: Forces long filenames to wrap instead of stretching the table */
    max-width: 300px; 
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.font-medium { font-weight: 500; }

.badge { padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.text-remark { padding: 10px; font-size: 0.9rem; color: #dc2626; font-style: italic; }

.history-empty { color: #64748b; text-align: center; font-style: italic; padding: 1rem 0; }
.logout-wrapper { text-align: center; margin-top: 2rem; }
.btn-logout { display: inline-block; padding: 10px 20px; background: white; border: 1px solid #e2e8f0; color: #64748b; text-decoration: none; font-size: 0.85rem; border-radius: 8px; width: auto;}

/* =========================================
   PAGINATION STYLES (Laravel Override)
   ========================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

ul.pagination {
    display: flex;
    list-style: none !important; /* Removes the bullet points */
    padding: 0;
    margin: 0;
    gap: 8px; /* Spaces the buttons apart */
}

ul.pagination li {
    display: inline-block;
}

/* Styles the actual numbers and arrows */
ul.pagination li a,
ul.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

/* The current page you are on */
ul.pagination li.active span {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* The disabled arrows (e.g., 'Previous' on page 1) */
ul.pagination li.disabled span {
    background: #f8fafc;
    color: #cbd5e1;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Hover effect for clickable pages */
ul.pagination li a:hover:not(.disabled) {
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

/* =========================================
   SEARCH & FILTER BAR
   ========================================= */
.search-bar {
    display: flex;
    gap: 12px;
    margin: 20px 0 30px 0;
    align-items: center;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.search-bar input {
    margin: 0;
    flex-grow: 1; /* Makes the search box take up remaining space */
    min-width: 200px;
    border: 1px solid #cbd5e1;
    background: white;
}

.search-bar select {
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    color: #0f172a;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    width: auto;
}

.search-bar .btn {
    width: auto; /* Stops buttons from stretching */
    margin: 0;
    padding: 0.85rem 1.5rem;
}

/* =========================================
   MICRO BUTTONS (For Tables)
   ========================================= */
.resubmit-wrapper {
    margin-top: 8px;
}

.btn-micro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #2563eb;
    color: #ffffff !important;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-micro:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* =========================================
   EMPTY STATE COMPONENT
   ========================================= */
.empty-state-box {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 3.5rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1;
}

.empty-state-title {
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
