/* =========================================================
   Lab C201 - Cisco Lab Management System
   Modern Premium CSS Design System
   ========================================================= */

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

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --sidebar-gradient: linear-gradient(180deg, #070e1b 0%, #0f172a 50%, #1e293b 100%);
    --hero-gradient: linear-gradient(135deg, #070e1b 0%, #0c2340 40%, #1d4ed8 100%);
    
    --bg-body: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    
    --info: #0ea5e9;
    --info-bg: #f0f9ff;
    --info-text: #075985;
    
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;
    --purple-text: #5b21b6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 30px -10px rgba(15, 23, 42, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --sidebar-width: 270px;
    --header-height: 70px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary);
}

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

.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
}

.brand-text h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    line-height: 1.2;
}

.brand-text small {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    font-weight: 700;
    padding: 12px 14px 6px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s ease;
}

.sidebar-menu li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-menu li a:hover i {
    color: #60a5fa;
}

.sidebar-menu li a.active {
    color: #ffffff;
    background: var(--primary-gradient);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.sidebar-menu li a.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.user-meta {
    flex-grow: 1;
    overflow: hidden;
}

.user-meta .name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta .role {
    font-size: 11px;
    color: #94a3b8;
}

.btn-logout {
    color: #ef4444;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 15px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle {
    display: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
}

.top-bar h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon-blue { background: #eff6ff; color: #2563eb; }
.stat-icon-green { background: #ecfdf5; color: #10b981; }
.stat-icon-amber { background: #fffbeb; color: #f59e0b; }
.stat-icon-purple { background: #f5f3ff; color: #8b5cf6; }
.stat-icon-red { background: #fef2f2; color: #ef4444; }

.stat-card .stat-info {
    flex-grow: 1;
}

.stat-card .number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary { background: var(--primary-gradient); color: #fff; }
.btn-success { background: linear-gradient(135deg, #059669 0%, #10b981 100%); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-info { background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border-color); color: var(--text-secondary); box-shadow: none; }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; align-items: center; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-available { background: var(--success-bg); color: var(--success-text); }
.badge-available .badge-dot { background: var(--success); }

.badge-borrowed { background: var(--info-bg); color: var(--info-text); }
.badge-borrowed .badge-dot { background: var(--info); }

.badge-maintenance { background: var(--warning-bg); color: var(--warning-text); }
.badge-maintenance .badge-dot { background: var(--warning); }

.badge-damaged { background: var(--danger-bg); color: var(--danger-text); }
.badge-damaged .badge-dot { background: var(--danger); }

.badge-pending { background: var(--warning-bg); color: var(--warning-text); }
.badge-pending .badge-dot { background: var(--warning); }

.badge-approved { background: var(--success-bg); color: var(--success-text); }
.badge-approved .badge-dot { background: var(--success); }

.badge-rejected { background: var(--danger-bg); color: var(--danger-text); }
.badge-rejected .badge-dot { background: var(--danger); }

.badge-returned { background: #f0f9ff; color: #0369a1; }
.badge-returned .badge-dot { background: #0284c7; }

.badge-overdue { background: #fdf2f8; color: #9d174d; }
.badge-overdue .badge-dot { background: #db2777; }

.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-inactive { background: #f1f5f9; color: #64748b; }

.role-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.role-user { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ===== TABLES ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 14px;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
    font-size: 13.5px;
}

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-success { background: var(--success-bg); color: var(--success-text); border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-left: 4px solid var(--info); }

/* ===== EQUIPMENT GRID ===== */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.equipment-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.equipment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.equipment-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.equipment-card-header .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.equipment-card-body {
    padding: 20px;
    flex-grow: 1;
}

.equipment-card-body h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.equipment-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.equipment-meta-item i {
    width: 16px;
    color: var(--text-muted);
}

.equipment-card-footer {
    padding: 16px 20px;
    background: #fafafa;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hero-gradient);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand .logo-box {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.auth-brand h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-brand p {
    font-size: 13.5px;
    color: var(--text-secondary);
}

.quick-accounts {
    background: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 20px;
    font-size: 12.5px;
}

.quick-accounts-title {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-btn-group {
    display: flex;
    gap: 8px;
}

.btn-chip {
    flex: 1;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    color: var(--primary);
    transition: all 0.2s;
}

.btn-chip:hover {
    background: #eff6ff;
    border-color: var(--primary-light);
}

/* ===== LANDING HERO ===== */
.hero-section {
    min-height: 100vh;
    background: var(--hero-gradient);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 60px;
    position: relative;
    overflow: hidden;
}

.hero-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    margin: 60px 0;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: #93c5fd;
    margin-bottom: 24px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-content h1 span {
    background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.feature-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.feature-box:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.feature-box i {
    font-size: 28px;
    color: #60a5fa;
    margin-bottom: 14px;
    display: inline-block;
}

.feature-box h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.feature-box p {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f1f5f9;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-tab:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px 20px;
    }
    .hero-content h1 {
        font-size: 38px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 16px;
    }
    .menu-toggle {
        display: inline-flex;
    }
    .hero-section {
        padding: 24px 20px;
    }
    .hero-content h1 {
        font-size: 32px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   REALTIME TOAST NOTIFICATIONS
   ========================================================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    width: 390px;
}

.toast-item {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

.toast-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.22);
}

.toast-item.toast-closing {
    animation: toastSlideOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.toast-icon.success {
    background: var(--success-bg);
    color: var(--success);
}
.toast-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.toast-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}
.toast-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.toast-body {
    flex-grow: 1;
    min-width: 0;
}

.toast-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.toast-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 6px 0;
    word-break: break-word;
}

.toast-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.toast-btn {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.toast-btn-primary {
    background: var(--primary);
    color: #ffffff !important;
}

.toast-btn-primary:hover {
    background: var(--primary-dark);
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.toast-close-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.toast-progress-bar {
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--primary-light);
    transform-origin: left;
    animation: toastProgress linear forwards;
}

.toast-item.success .toast-progress-fill { background: var(--success); }
.toast-item.warning .toast-progress-fill { background: var(--warning); }
.toast-item.danger .toast-progress-fill { background: var(--danger); }
.toast-item.info .toast-progress-fill { background: var(--info); }

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

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

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}