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

/* ============================================================
   DESIGN TOKENS — Professional White Theme
   ============================================================ */
:root {
    --primary:          #4f46e5;
    --primary-hover:    #4338ca;
    --primary-light:    #ede9fe;
    --primary-text:     #4f46e5;

    --bg:               #f5f6fa;
    --sidebar-bg:       #ffffff;
    --card-bg:          #ffffff;

    --border:           #e5e7eb;
    --border-light:     #f3f4f6;

    --text:             #111827;
    --text-secondary:   #374151;
    --text-muted:       #6b7280;
    --text-faint:       #9ca3af;

    --success:          #059669;
    --success-bg:       #ecfdf5;
    --success-border:   #a7f3d0;

    --error:            #dc2626;
    --error-bg:         #fef2f2;
    --error-border:     #fecaca;

    --warning:          #d97706;
    --warning-bg:       #fffbeb;
    --warning-border:   #fde68a;

    --amber:            #f59e0b;
    --amber-bg:         rgba(245,158,11,0.08);
    --amber-border:     rgba(245,158,11,0.25);

    --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:        0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:        0 10px 30px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.05);

    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        20px;

    --sidebar-width:    260px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.15rem;
    letter-spacing: 0.01em;
}

.status-indicator.offline {
    color: var(--text-muted);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(5,150,105,0.5);
    animation: pulse 2s infinite;
}

.status-indicator.offline .pulse-dot {
    background: var(--text-faint);
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5,150,105,0.5); }
    70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(5,150,105,0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.25rem 0 0.4rem 0.6rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.nav-item:hover {
    background: var(--border-light);
    color: var(--text-secondary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100vw - var(--sidebar-width));
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.main-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.main-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
    padding: 0.45rem 0.9rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.sync-badge i {
    width: 14px;
    height: 14px;
}

/* ============================================================
   PANELS
   ============================================================ */
.content-panel {
    display: none;
    animation: fadeUp 0.25s ease forwards;
}

.content-panel.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 800px;
}

.card.full-width {
    max-width: 100%;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.card h2 i {
    color: var(--primary);
    width: 1.1rem;
    height: 1.1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    user-select: none;
}

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

.stat-card:active {
    transform: translateY(0);
}

/* Active / selected state */
.stat-card.active-blue  { border-top-color: var(--primary); background: #fafaff; }
.stat-card.active-red   { border-top-color: var(--error);   background: #fff5f5; }
.stat-card.active-amber { border-top-color: var(--warning);  background: #fffdf0; }

/* Small hint label in bottom-right corner */
.stat-card::after {
    content: 'Click to filter';
    position: absolute;
    bottom: 0.5rem;
    right: 0.85rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
}

.stat-card:hover::after   { opacity: 1; }
.stat-card.active-blue::after  { content: 'Showing all'; opacity: 1; color: var(--primary); }
.stat-card.active-red::after   { content: 'Filtered';    opacity: 1; color: var(--error); }
.stat-card.active-amber::after { content: 'Filtered';    opacity: 1; color: var(--warning); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    width: 1.4rem;
    height: 1.4rem;
}

.stat-icon.blue   { background: #ede9fe; color: var(--primary); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.amber  { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red    { background: var(--error-bg);   color: var(--error); }

/* ============================================================
   FILTER INDICATOR PILL
   ============================================================ */
.filter-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
    margin-bottom: 0.75rem;
    animation: rowIn 0.2s ease;
}

.filter-active-pill button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-active-pill button:hover { opacity: 1; }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.3;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.filter-bar-label i {
    color: var(--primary);
    width: 1rem;
    height: 1rem;
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.filter-sep {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/* ============================================================
   INPUTS & BUTTONS
   ============================================================ */
input[type="date"],
input[type="text"],
input[type="number"],
select {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="date"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    background: #fff;
}

button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-size: 0.875rem;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

button i {
    width: 14px;
    height: 14px;
}

/* Primary action button */
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 0.55rem 1.1rem;
    box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 3px 8px rgba(79,70,229,0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary / ghost button */
.secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
}

.secondary:hover {
    background: var(--border-light);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    text-align: left;
    padding: 0.9rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr.analytics-main-row:hover td {
    background: #fafafa;
}

.table-loading {
    text-align: center;
    padding: 4rem !important;
    color: var(--text-muted);
    line-height: 2.2;
    font-size: 0.9rem;
}

.table-loading i {
    display: block;
    margin: 0 auto 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--primary);
}

/* ============================================================
   BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* In-hours — green */
.badge-in {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* Off-hours — red */
.badge-out {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

/* Early departure — amber */
.badge-early {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* Late arrival — rose/red */
.badge-late {
    background: #fff5f5;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

/* Method — neutral */
.badge-method {
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-transform: uppercase;
}

/* Login scan — purple */
.badge-login {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
}

/* Plain scan */
.badge-scan {
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ============================================================
   DRILL-DOWN ROW
   ============================================================ */
.analytics-detail-row td {
    background: #f9fafb;
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
}

.drill-down-inner {
    padding: 1rem 1.5rem 1.25rem 3.25rem;
}

.drill-down-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.scan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 0.4rem;
    transition: background 0.15s;
}

.scan-item:last-child { margin-bottom: 0; }
.scan-item:hover { background: #f5f5ff; }

.scan-num {
    font-size: 0.7rem;
    color: var(--text-faint);
    width: 20px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

.scan-time {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    min-width: 90px;
    flex-shrink: 0;
}

.scan-method {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.scan-note {
    font-size: 0.78rem;
    color: var(--warning);
    font-style: italic;
}

/* ============================================================
   CHEVRON TOGGLE
   ============================================================ */
.row-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-faint);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.row-chevron.open {
    transform: rotate(90deg);
    color: var(--primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
    min-width: 280px;
    max-width: 400px;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-success i { color: var(--success); }
.toast.toast-error   { border-left-color: var(--error); }
.toast.toast-error   i { color: var(--error); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-warning i { color: var(--warning); }

.toast i { width: 18px; height: 18px; flex-shrink: 0; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(110%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-fadeOut {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40%) scale(0.95); }
}

/* ============================================================
   SPIN ANIMATION
   ============================================================ */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   FADE-IN ROW ANIMATION
   ============================================================ */
@keyframes rowIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    margin: 0 auto 0.75rem;
    color: var(--text-faint);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================================
   WEBHOOK SYSTEM STYLE SHEET
   ============================================================ */

.webhook-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .webhook-grid {
        grid-template-columns: 1fr;
    }
}

.webhook-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.url-input-container {
    display: flex;
}

.url-input {
    flex: 1;
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

/* Toggle Switch Styles */
.form-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toggle-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Switch toggle switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Instruction Card / Tester Info */
.instruction-card {
    background: #fafaff;
    border-color: #dbeafe;
}

.instruction-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
}

.receiver-url-box {
    margin: 1rem 0;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.url-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.35rem;
}

.url-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.url-value-wrapper code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e3a8a;
    word-break: break-all;
    user-select: all;
}

.btn-copy-url {
    background: none;
    border: none;
    padding: 0.3rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--primary);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-url:hover {
    background: var(--primary-light);
}

.btn-copy-url i {
    width: 15px;
    height: 15px;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
}

.step-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Webhook Logs Columns Container */
.webhook-logs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .webhook-logs-container {
        grid-template-columns: 1fr;
    }
}

.log-column {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 600px;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    height: 28px;
}

.webhook-log-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f9fafb;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.log-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: 100%;
    color: var(--text-faint);
    text-align: center;
    padding: 2rem;
}

.log-empty-state i {
    width: 1.75rem;
    height: 1.75rem;
}

.log-empty-state p {
    font-size: 0.8rem;
}

/* Log Item styling */
.webhook-log-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.webhook-log-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.webhook-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.webhook-log-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.webhook-log-event {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.webhook-log-time {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.webhook-log-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.webhook-log-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.webhook-log-badge.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.webhook-log-badge.failure {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

.webhook-log-code {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.webhook-log-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-faint);
    transition: transform 0.2s ease;
}

.webhook-log-chevron.open {
    transform: rotate(90deg);
}

.webhook-log-details {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.details-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.payload-pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.6rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: #334155;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 180px;
    overflow-y: auto;
}

.error-message-box {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border: 1px solid var(--error);
    border-radius: 0.375rem;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 3px 8px rgba(220,38,38,0.35);
}
.btn-danger:active {
    transform: translateY(1px);
}