:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.18), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(147, 51, 234, 0.15), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08), transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* Glassmorphism utility */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Login View */
#login-view {
    justify-content: center;
    align-items: center;
}
.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-card h2 {
    margin-bottom: 24px;
    font-weight: 600;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 16px;
    text-align: left;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}
.input-group input:focus {
    border-color: var(--accent);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.primary-btn {
    background: var(--accent);
    color: #fff;
}
.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}
form .btn, form .primary-btn {
    width: 100%;
}
.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.error-msg {
    color: var(--error);
    margin-top: 12px;
    font-size: 0.9rem;
}

/* Navigation */
.glass-nav {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.glass-nav h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links {
    display: flex;
    gap: 16px;
}
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.logout-btn {
    color: #ef4444;
}
.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.panel.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.header-action-btns {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.header-action h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

/* Table */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}
th {
    color: var(--text-secondary);
    font-weight: 500;
}
.status-success { color: var(--success); }
.status-error { color: var(--error); }

/* Accounts Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.account-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.account-card h3 {
    font-size: 1.4rem;
    color: var(--accent);
}
.account-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
}
.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 8px 16px;
}
.delete-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease;
}
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.close-btn {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.close-btn:hover {
    color: var(--text-primary);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-error { background: rgba(239, 68, 68, 0.2); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: var(--accent); border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-idle { background: rgba(148, 163, 184, 0.2); color: var(--text-secondary); border: 1px solid rgba(148, 163, 184, 0.4); }

/* Dashboard Summary Cards */
.summary-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}
.summary-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}
.summary-card.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 0 2px var(--accent);
}

/* Token Management Table */
.token-code {
    font-family: monospace;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    color: #e2e8f0;
}
.token-row-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Switch Toggle UI */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    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(148, 163, 184, 0.4);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--success);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Fullscreen Drag Overlay */
#drag-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    border: 4px dashed var(--accent);
    color: var(--text-primary);
    pointer-events: none;
}
#drag-overlay.active {
    display: flex;
}

/* Lifecycle Diagram Styling */
.lifecycle-card {
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}
.lifecycle-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 16px 0;
    gap: 8px;
    overflow-x: auto;
}
.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    min-width: 110px;
}
.flow-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}
.flow-step:hover .flow-icon-circle {
    transform: scale(1.1);
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}
.flow-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    color: var(--text-primary);
}
.flow-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.flow-arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.6;
    animation: pulseArrow 2s infinite;
}
@keyframes pulseArrow {
    0%, 100% { transform: translateX(0); opacity: 0.4; }
    50% { transform: translateX(4px); opacity: 1; color: var(--accent); }
}

/* Live Stepper Tracker Modal */
.stepper-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}
.stepper-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    transition: all 0.3s;
}
.stepper-item.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
.stepper-item.completed {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}
.stepper-item.failed {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}
.stepper-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
}
.stepper-item.completed .stepper-icon {
    background: var(--success);
    color: #fff;
}
.stepper-item.failed .stepper-icon {
    background: var(--error);
    color: #fff;
}
.stepper-item.active .stepper-icon {
    background: var(--accent);
    color: #fff;
    animation: spinIcon 1.5s linear infinite;
}
@keyframes spinIcon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Monthly Calendar Styling */
.calendar-card {
    padding: 24px;
}
.calendar-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}
.calendar-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.calendar-nav-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}
.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}
.cal-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--card-border);
}
.cal-day-cell {
    min-height: 100px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}
.cal-day-cell:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.cal-day-cell.other-month {
    opacity: 0.35;
    background: rgba(15, 23, 42, 0.2);
}
.cal-day-cell.today {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-day-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.cal-badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    display: inline-block;
    word-break: break-all;
}
.cal-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.cal-badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.4);
}
/* Stats Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(59, 130, 246, 0.15);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
    font-family: 'Outfit', sans-serif;
}

/* Glassmorphism Toast Notifications */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(50px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-show {
    opacity: 1;
    transform: translateX(0) scale(1);
}
.toast-success {
    border-left: 4px solid var(--success);
}
.toast-error {
    border-left: 4px solid var(--error);
}
.toast-info {
    border-left: 4px solid var(--accent);
}





