/* Global resets & variables */
:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --color-primary: #8b5cf6;
    --color-primary-hover: #7c3aed;
    --color-secondary: #0d9488;
    --color-secondary-hover: #0f766e;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --status-pending: #eab308;
    --status-matched: #10b981;
    --status-failed: #ef4444;
    --status-info: #3b82f6;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated glow */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(13, 148, 136, 0.15) 0%, transparent 40%);
    background-size: cover;
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Sidebar styling */
.sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-glass);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    color: #fff;
}

.sidebar-logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    user-select: none;
}

.nav-item .nav-link-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-item i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    transition: color 0.25s ease;
}

/* Active status matching user screenshot (AI Ayarları active style) */
.nav-item.active {
    background: rgba(30, 41, 59, 0.8);
    color: #60a5fa; /* Blue color text */
    border: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.nav-item.active i {
    color: #60a5fa;
}

.nav-item.active::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 8px #3b82f6;
    margin-left: 0.5rem;
}

.nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--status-matched);
    box-shadow: 0 0 10px var(--status-matched);
}

/* Main Content area */
.main-content {
    padding: 2.5rem;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tabs & Layouts */
.tab-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-grow: 1;
}

.tab-content.hidden {
    display: none !important;
}

/* Dashboard specific stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card-icon.primary {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-primary);
}

.stat-card-icon.secondary {
    background: rgba(13, 148, 136, 0.15);
    color: var(--color-secondary);
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-matched);
}

.stat-card-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.stat-card-info {
    display: flex;
    flex-direction: column;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.15rem;
}

/* Payments Tab Layout */
.payments-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .payments-layout {
        grid-template-columns: 1fr;
    }
}

/* WhatsApp Centered Layout */
.whatsapp-layout {
    max-width: 600px;
    margin: 1.5rem auto;
    width: 100%;
}

/* Settings Centered Layout */
.settings-layout {
    max-width: 700px;
    margin: 1rem auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Responsive sidebar */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        height: auto;
        position: relative;
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    .sidebar-top {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .sidebar-logo {
        margin-bottom: 0;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        gap: 0.5rem;
        padding: 0.5rem 0;
        margin-top: 1rem;
    }
    .nav-item {
        padding: 0.6rem 1rem;
        white-space: nowrap;
    }
    .sidebar-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border-glass);
        padding-top: 1rem;
        margin-top: 0.5rem;
    }
    .main-content {
        height: auto;
        padding: 1.5rem;
    }
    .whatsapp-layout, .settings-layout {
        max-width: 100%;
        margin: 0;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 i {
    color: var(--color-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex-grow: 1;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-secondary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-secondary:hover {
    background: var(--color-secondary-hover);
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-connected {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-connecting {
    background: rgba(234, 179, 8, 0.15);
    color: #fef08a;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.count-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status Banner */
.status-success-banner {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #a7f3d0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Connection Body */
.connection-body {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.conn-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    width: 100%;
}

.conn-state.hidden {
    display: none !important;
}

.qr-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.qr-container {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 180px;
    height: 180px;
}

#qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

/* User profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile .avatar {
    width: 44px;
    height: 44px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.user-profile h3 {
    font-size: 1rem;
    font-weight: 600;
}

.user-profile p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tables */
.table-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.empty-state {
    color: var(--text-muted);
    padding: 3rem !important;
}

.text-center {
    text-align: center;
}

.status-pill {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-pill.pending {
    background: rgba(234, 179, 8, 0.1);
    color: var(--status-pending);
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.status-pill.matched {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-matched);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-failed);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Logs area */
.log-container {
    height: 380px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0 0 16px 16px;
    padding: 1rem;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-log-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 4rem 2rem;
}

.log-entry {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.log-entry-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-status-badge {
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.log-status-badge.analyzing {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.log-status-badge.matched {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.log-status-badge.duplicate {
    background: rgba(234, 179, 8, 0.15);
    color: #fef08a;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.log-status-badge.no_match {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.log-status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.extracted-details {
    margin-top: 0.25rem;
    background: rgba(15, 23, 42, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

.extracted-details p {
    margin-bottom: 0.15rem;
}

.extracted-details p:last-child {
    margin-bottom: 0;
}

/* Utilities */
.text-teal { color: var(--color-secondary) !important; }
.mt-3 { margin-top: 1rem; }
.btn-delete {
    background: transparent;
    color: var(--status-failed);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: transform 0.1s ease;
}
.btn-delete:hover {
    transform: scale(1.15);
}
.btn-edit {
    background: transparent;
    color: var(--color-primary);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    margin-right: 0.5rem;
    transition: transform 0.1s ease;
    display: inline-block;
}
.btn-edit:hover {
    transform: scale(1.15);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
}

/* Toggle Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.05);
  transition: .3s;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .3s;
}

input:checked + .slider {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

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

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

/* Sağa Hizalı İstatistik İkonları */
.stat-card-icon-right {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-left: auto;
}

.stat-card-icon-right.primary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-primary);
}

.stat-card-icon-right.secondary {
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-secondary);
}

.stat-card-icon-right.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-matched);
}

.stat-card-icon-right.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
}

.stat-card-icon-right.warning {
    background: rgba(234, 179, 8, 0.1);
    color: var(--status-pending);
}

.stat-card-icon-right.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-failed);
}

.chart-card {
    height: 360px;
}

/* Connection Steps styling */
.connection-steps-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 1.5rem 0 1rem 0;
    padding: 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    position: relative;
    gap: 0.5rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
    z-index: 2;
}

.step-icon-container {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.3s ease;
    max-width: 90px;
}

/* Step connector line */
.connection-steps-flow::before {
    content: '';
    position: absolute;
    top: 23px; /* centers the line vertically with the 28px circles */
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

/* Step States */
.step-item.pending .step-icon-container {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.2);
}

.step-item.pending .step-text {
    color: rgba(255, 255, 255, 0.25);
}

.step-item.active .step-icon-container {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    animation: pulseActive 2s infinite;
}

.step-item.active .step-text {
    color: #fff;
    font-weight: 600;
}

.step-item.completed .step-icon-container {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.step-item.completed .step-text {
    color: #10b981;
    opacity: 0.8;
}

.step-item.failed .step-icon-container {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.step-item.failed .step-text {
    color: #ef4444;
}

@keyframes pulseActive {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Modal Container */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal Overlay Blur */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 1;
}

/* Modal Content Card */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 2;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: modalShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modalShow {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2 i {
    color: var(--color-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.3);
    min-height: 300px;
}

/* Image container with rotation support */
.image-viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    min-height: 280px;
}

.image-viewer-container img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Custom view receipt button styling inside logs list */
.btn-view-receipt {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #c084fc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 0.5rem;
}

.btn-view-receipt:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.25);
}
