/* ============================================
   E-Service Frontend Dashboard Styles
   ============================================ */

.esfd-wrap { font-family: inherit; max-width: 1200px; margin: 0 auto; }

/* Header */
.esfd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e5e7eb;
}
.esfd-header-left { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.esfd-title { margin: 0; font-size: 20px; }
.esfd-user  { font-size: 13.5px; color: #666; }
.esfd-header-right { display: flex; gap: 8px; }

/* Buttons */
.esfd-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .2s;
    line-height: 1.4;
}
.esfd-btn:hover { opacity: .85; text-decoration: none; }
.esfd-btn-print  { background: #1d2327; color: #fff; }
.esfd-btn-logout { background: #d63638; color: #fff; }
.esfd-btn-filter { background: #2271b1; color: #fff; }
.esfd-btn-reset  { background: #f0f0f1; color: #333; border: 1px solid #ccc; }

.esfd-btn-sm {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    cursor: pointer;
    border: 1px solid #2271b1;
    background: #f0f6fc;
    color: #2271b1;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}
.esfd-btn-sm:hover { background: #2271b1; color: #fff; }

/* Stat Cards */
.esfd-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.esfd-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: border-color .2s, box-shadow .2s;
}
.esfd-card:hover, .esfd-card.active {
    border-color: var(--c);
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    text-decoration: none;
}
.esfd-card.active { background: color-mix(in srgb, var(--c) 8%, white); }
.esfd-card-icon  { font-size: 24px; line-height: 1; }
.esfd-card-count { font-size: 28px; font-weight: 700; color: var(--c); line-height: 1; }
.esfd-card-label { font-size: 12px; color: #555; font-weight: 500; }

/* Filter */
.esfd-filter {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.esfd-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.esfd-input, .esfd-select, .esfd-date {
    padding: 7px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 13.5px;
    height: 36px;
    box-sizing: border-box;
}
.esfd-input  { min-width: 200px; }
.esfd-select { min-width: 170px; }
.esfd-date   { width: 130px; }

/* Table */
.esfd-table-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.esfd-table-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14.5px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}
.esfd-badge-count {
    background: #f0f0f1;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}
.esfd-empty { padding: 30px; text-align: center; color: #888; }
.esfd-table-scroll { overflow-x: auto; }
.esfd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 800px;
}
.esfd-table th {
    background: #f6f7f7;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}
.esfd-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.esfd-table tr:last-child td { border-bottom: none; }
.esfd-table tr:hover td { background: #f9f9f9; }

.esfd-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Modal */
#esfd-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.esfd-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 30px;
    width: 450px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.esfd-modal-box h3 { margin-top: 0; font-size: 17px; }
.esfd-modal-box label { font-weight: 600; font-size: 13.5px; display: block; margin-top: 10px; }
.esfd-modal-select {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 6px;
}
.esfd-modal-box textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13.5px;
    margin-top: 6px;
    box-sizing: border-box;
    resize: vertical;
}
.esfd-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
#esfd-modal-msg { font-size: 13px; margin-top: 8px; min-height: 20px; }

/* Login Form */
.esfd-login-wrap {
    display: flex;
    justify-content: center;
    padding: 30px 16px;
}
.esfd-login-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 32px 36px;
    width: 380px;
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    text-align: center;
}
.esfd-login-box h2 { margin-top: 0; font-size: 20px; }
.esfd-login-box p  { color: #666; font-size: 14px; margin-bottom: 20px; }
.esfd-login-box .login-username,
.esfd-login-box .login-password { margin-bottom: 14px; text-align: left; }
.esfd-login-box label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 5px; }
.esfd-login-box input[type="text"],
.esfd-login-box input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.esfd-login-box input[type="submit"] {
    width: 100%;
    padding: 11px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}
.esfd-login-box input[type="submit"]:hover { background: #195a8a; }

/* ============================================
   PRINT
   ============================================ */
@media print {
    .no-print, #esfd-modal { display: none !important; }
    .print-only { display: block !important; }

    .esfd-wrap { font-size: 10.5pt; }

    .esfd-cards {
        display: grid !important;
        grid-template-columns: repeat(5,1fr);
        gap: 6px;
        margin-bottom: 14px;
    }
    .esfd-card {
        border: 1.5pt solid #333 !important;
        border-radius: 4px !important;
        padding: 8px !important;
        page-break-inside: avoid;
    }
    .esfd-card-count { font-size: 18pt !important; color: #000 !important; }
    .esfd-card-icon  { font-size: 14pt !important; }
    .esfd-card-label { font-size: 8.5pt !important; }

    .esfd-table-wrap { border: 1pt solid #333; }
    .esfd-table { min-width: unset; font-size: 9.5pt; }
    .esfd-table th { background: #e5e5e5 !important; padding: 5px 7px; }
    .esfd-table td { padding: 5px 7px; border-bottom: .5pt solid #ccc; }
    .esfd-table tr:hover td { background: none !important; }
    .esfd-status-badge {
        color: #000 !important;
        background: none !important;
        border: 1pt solid #333;
        padding: 1px 5px;
    }
    .esfd-print-header { text-align: center; margin-bottom: 14px; }
    .esfd-print-header h2 { font-size: 15pt; margin-bottom: 3px; }
    .esfd-print-header p  { font-size: 9.5pt; }
    .esfd-print-footer { margin-top: 16px; border-top: 1pt solid #aaa; padding-top: 10px; }

    @page { margin: 1.5cm 2cm; size: A4 landscape; }
}
.print-only { display: none; }

/* Responsive */
@media (max-width: 960px) {
    .esfd-cards { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 600px) {
    .esfd-cards { grid-template-columns: repeat(2,1fr); }
    .esfd-header { flex-direction: column; align-items: flex-start; }
}
