:root {
    --bg-dark: #0f111a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for Visual Excellence */
.background-blobs {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
}
.blob-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
}
.blob-2 {
    bottom: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.header-content p {
    color: var(--text-muted);
}
.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Card (Glassmorphism) */
.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}
.client-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card-hover);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}
.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.auth-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-badge.auth-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.card-body {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}
.card-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.card-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: auto;
}
.card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: #1e212f;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.modal.hidden .modal-content {
    transform: translateY(20px);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover { color: #fff; }

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
input:focus {
    border-color: var(--primary);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e212f;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}
.hidden { display: none !important; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.empty-state h3 {
    margin-bottom: 0.5rem;
}
.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Details Modal Large */
.modal-large {
    max-width: 800px;
    width: 95%;
}

.details-body {
    padding-top: 1rem;
}

/* Tabs */
.details-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: #fff;
    background: var(--primary);
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}
.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.info-value {
    font-size: 0.95rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    word-break: break-all;
}

/* History Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}
.history-table th, .history-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}
.history-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.btn-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}
.btn-link:hover {
    text-decoration: underline;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}
.auth-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.auth-card .form-group {
    margin-bottom: 1.25rem;
}
.auth-card label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.auth-card input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}
.auth-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.btn-block {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
}
.btn-glow {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}
.btn-glow:hover {
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.6);
}
.auth-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-footer .btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

/* Interactive Wizard */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}
.wizard-step-node {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}
.wizard-step-node.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 12px var(--primary);
    transform: scale(1.15);
}
.wizard-step-node.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.wizard-content-container {
    position: relative;
    min-height: 320px;
}
.wizard-pane {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.wizard-pane.active-pane {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.wizard-pane-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}
@media (max-width: 768px) {
    .wizard-pane-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
.wizard-pane-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    height: 220px;
    overflow: hidden;
    position: relative;
}

/* Animations and Visuals inside Wizard */
.mock-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    width: 200px;
    transition: all 0.3s ease;
}
.mock-card-glow {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    animation: pulseGlow 2s infinite alternate;
}
@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
    to { box-shadow: 0 0 20px rgba(99, 102, 241, 0.5); }
}
.mock-input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: left;
}

.mock-google-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.mock-google-btn {
    background: white;
    color: #1f2937;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: floatBtn 3s infinite ease-in-out;
}
@keyframes floatBtn {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.scanning-container {
    position: relative;
    width: 180px;
    height: 120px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
}
.scanning-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: scanAnimation 2s infinite ease-in-out;
    z-index: 2;
}
@keyframes scanAnimation {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}
.mock-envelope {
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    border-radius: 6px;
    animation: pulseText 1.5s infinite;
}
@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.mock-drive-folder-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.mock-drive-folder {
    animation: floatBtn 3.5s infinite ease-in-out;
}
.mock-excel-file {
    animation: floatBtn 3s infinite ease-in-out;
    animation-delay: 0.5s;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}
