* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}
.card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 490px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
}
.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.badge {
    display: inline-block;
    background: #10B981;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
}
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
}
.dot {
    width: 7px;
    height: 7px;
    background: #10B981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
h1 {
    font-size: 24px;
    color: #1F2937;
    margin-bottom: 6px;
}
.subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 22px;
}
.info-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    text-align: left;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #F1F5F9;
}
.info-row:last-child { border-bottom: none; }
.label { color: #64748B; font-weight: 500; }
.value { color: #0F172A; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 999px;
    margin-top: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #4F46E5;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn {
    display: inline-block;
    width: 100%;
    background: #4F46E5;
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn:hover { background: #4338CA; }
.btn-secondary {
    background: #0F172A;
}
.btn-secondary:hover { background: #1E293B; }
.footer {
    margin-top: 18px;
    font-size: 12px;
    color: #94A3B8;
}

/* Modal Style */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 950px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; display: flex; align-items: center; gap: 8px; }
.close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #94A3B8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.close-btn:hover { color: #0F172A; background: #F1F5F9; }
.modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
}
.input-text {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.input-text:focus { border-color: #4F46E5; }
.error-msg {
    color: #EF4444;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.stat-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
}
.stat-label { font-size: 11px; font-weight: 600; color: #64748B; margin-bottom: 4px; }
.stat-val { font-size: 18px; font-weight: 700; color: #0F172A; }
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}
.log-table {
    width: 100%;
    min-width: 850px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}
.log-table th {
    background: #F8FAFC;
    padding: 10px 8px;
    color: #64748B;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
.log-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
}
.status-200 { background: #DCFCE7; color: #15803D; }
.status-400 { background: #FEE2E2; color: #B91C1C; }

.col-path {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.col-path:hover {
    background: #F1F5F9;
    border-radius: 4px;
}
.col-device {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-time-th { width: 155px; }
.col-ip-th { width: 135px; }
.col-req-th { width: auto; }
.col-status-th { width: 65px; }
.col-dev-th { width: 150px; }


.blacklist-table {
    width: 100%;
    min-width: 360px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}
.blacklist-table th {
    background: #F8FAFC;
    padding: 8px 6px;
    color: #64748B;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
.blacklist-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bl-col-time { width: 130px; }
.bl-col-ip { width: 115px; }
.bl-col-reason { width: auto; }
.bl-col-action { width: 55px; text-align: center; }
