/* ============================================
   INSTENTWORK - 3D CARTOON STYLE
   Version: 9.0 (FINAL + CINEMATIC POPUP)
   ============================================ */

/* ============================================
   RESET & VARIABLES
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --coral: #FF6B6B;
    --coral-dark: #EE5A5A;
    --coral-light: #FF8E8E;
    --turquoise: #4ECDC4;
    --turquoise-dark: #3DBDB4;
    --turquoise-light: #7DDDD6;
    --yellow: #FFE66D;
    --yellow-dark: #FFD93D;
    --yellow-light: #FFF1A8;
    --lavender: #A78BFA;
    --lavender-dark: #9370E8;
    --mint: #6EE7B7;
    --mint-dark: #4ADE80;
    --mint-light: #A7F3D0;
    
    --success: #6EE7B7;
    --danger: #FF4757;
    --warning: #FFA502;
    
    --text: #1a1a1a;
    --text-light: #4a4a4a;
    --text-lighter: #8a8a8a;
    --white: #ffffff;
    
    --bg: #FFF8F0;
    --bg-gradient: linear-gradient(135deg, #FFE6E6 0%, #E0F7F4 50%, #FFF4D6 100%);
    --border: #FFE0E0;
    
    --shadow: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    --sidebar-width: 260px;
    --bottomnav-height: 64px;
}

/* ============================================
   HTML & BODY
   ============================================ */
html {
    height: 100%;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

body.no-scroll { overflow: hidden; }

body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    filter: blur(40px);
}

body::before {
    width: 400px; height: 400px;
    background: var(--coral-light);
    top: -100px; left: -100px;
    animation: floatShape 8s ease-in-out infinite;
}

body::after {
    width: 300px; height: 300px;
    background: var(--turquoise-light);
    bottom: -100px; right: -100px;
    animation: floatShape 10s ease-in-out infinite reverse;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(30px,-30px) scale(1.1); }
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; height: auto; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

p { color: var(--text-light); }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-wrapper {
    flex: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 28px 26px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    border: 3px solid #ffffff;
    position: relative;
    z-index: 1;
    animation: cardPopIn 0.6s var(--bounce);
    margin: auto;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--coral), var(--turquoise), var(--yellow));
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
}

@keyframes cardPopIn {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--coral), var(--yellow));
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 0 rgba(255,107,107,0.4);
    animation: logoBounce 2s ease-in-out infinite;
    transform: rotate(-5deg);
    flex-shrink: 0;
}

@keyframes logoBounce {
    0%, 100% { transform: rotate(-5deg) translateY(0); }
    50% { transform: rotate(5deg) translateY(-4px); }
}

.auth-header { text-align: center; margin-bottom: 16px; }
.auth-header h1 { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.auth-header p { color: var(--text-light); font-size: 12px; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 12px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
}

.form-label .required { color: var(--coral); margin-left: 2px; }

.input-wrapper { position: relative; width: 100%; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: #ffffff;
    transition: all 0.3s var(--bounce);
    outline: none;
}
.form-input::placeholder { color: var(--text-lighter); font-weight: 400; }
.form-input:focus {
    border-color: var(--coral);
    box-shadow: 0 3px 0 rgba(255,107,107,0.2);
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--yellow-light);
    border: 2px solid var(--yellow);
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    margin-bottom: 12px;
    font-weight: 500;
}
.form-checkbox input[type="checkbox"] {
    width: 15px; height: 15px;
    margin-top: 1px;
    accent-color: var(--coral);
    cursor: pointer;
    flex-shrink: 0;
}
.form-checkbox a { color: var(--coral); font-weight: 700; }

.form-help { font-size: 10px; color: var(--text-lighter); margin-top: 4px; display: block; }
.form-error {
    font-size: 10px;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}
.form-error.show { display: block; }

.password-strength { margin-top: 6px; display: none; }
.password-strength.show { display: block; }
.strength-bar { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.strength-fill { height: 100%; width: 0; transition: all 0.3s ease; }
.strength-fill.weak { width: 33%; background: var(--danger); }
.strength-fill.medium { width: 66%; background: var(--warning); }
.strength-fill.strong { width: 100%; background: var(--success); }
.strength-text { font-size: 10px; font-weight: 600; }
.strength-text.weak { color: var(--danger); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.15s var(--bounce);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    box-sizing: border-box;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-block { width: 100%; padding: 12px 18px; font-size: 14px; }

.btn-primary {
    background: linear-gradient(135deg, var(--coral), var(--coral-dark));
    color: white;
    box-shadow: 0 4px 0 var(--coral-dark), 0 6px 12px rgba(255,107,107,0.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:active:not(:disabled) { transform: translateY(2px); }

.btn-secondary {
    background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark));
    color: white;
    box-shadow: 0 4px 0 var(--turquoise-dark), 0 6px 12px rgba(78,205,196,0.3);
}
.btn-secondary:hover:not(:disabled) { transform: translateY(-2px); }

.btn-success {
    background: linear-gradient(135deg, var(--mint), var(--mint-dark));
    color: white;
    box-shadow: 0 4px 0 #2D9B5F, 0 6px 12px rgba(110,231,183,0.3);
}
.btn-success:hover:not(:disabled) { transform: translateY(-2px); }

.btn-danger {
    background: linear-gradient(135deg, #FF6B6B, #EE5A5A);
    color: white;
    box-shadow: 0 4px 0 #C92A2A, 0 6px 12px rgba(255,71,87,0.3);
}
.btn-danger:hover:not(:disabled) { transform: translateY(-2px); }

.btn-outline {
    background: #ffffff;
    color: var(--text);
    border: 2px solid var(--border);
    box-shadow: 0 4px 0 var(--border);
}
.btn-outline:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--coral); color: var(--coral); }

.btn-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 2px solid;
}
.alert-icon { font-size: 16px; flex-shrink: 0; line-height: 1; }
.alert-content { flex: 1; line-height: 1.4; word-break: break-word; }
.alert-success { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #065F46; border-color: var(--mint); }
.alert-danger { background: linear-gradient(135deg, #FFE4E4, #FFC9C9); color: #991B1B; border-color: var(--coral-light); }
.alert-warning { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; border-color: var(--yellow); }
.alert-info { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #1E40AF; border-color: #93C5FD; }

.auth-link { text-align: center; margin-top: 12px; font-size: 12px; color: var(--text-light); }
.auth-link a { color: var(--coral); font-weight: 800; }

.auth-divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
    font-size: 10px;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 2px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-wrapper {
    flex: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    transition: margin-left 0.3s var(--smooth);
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

@media (min-width: 1025px) {
    .main-wrapper {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100% - var(--sidebar-width));
    }
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    border-right: 3px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s var(--smooth);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}

.sidebar.open { transform: translateX(0); }

@media (min-width: 1025px) {
    .sidebar { transform: translateX(0); }
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 900;
    color: var(--coral);
}

.sidebar-logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--coral), var(--yellow));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 3px 0 rgba(255,107,107,0.4);
    transform: rotate(-5deg);
    flex-shrink: 0;
}

.sidebar-close {
    background: var(--bg);
    border: 2px solid var(--border);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

@media (max-width: 1024px) {
    .sidebar-close { display: flex; }
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 12px 14px;
    background: var(--bg-gradient);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 3px 0 rgba(255,107,107,0.3);
    border: 2px solid white;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-size: 13px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 10px; color: var(--coral);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: var(--bg);
    color: var(--coral);
    transform: translateX(3px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--coral), var(--coral-dark));
    color: white;
    box-shadow: 0 3px 0 var(--coral-dark), 0 4px 12px rgba(255,107,107,0.3);
}

.sidebar-item-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-item-label {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-footer { padding: 12px; border-top: 2px solid var(--border); flex-shrink: 0; }
.sidebar-item.logout { color: var(--coral); }
.sidebar-item.logout:hover { background: rgba(255,107,107,0.1); }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.nav-overlay.show { opacity: 1; visibility: visible; }

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 3px solid var(--border);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    flex-shrink: 0;
    width: 100%;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }

.topbar-hamburger {
    background: var(--bg);
    border: 2px solid var(--border);
    width: 38px; height: 38px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

@media (min-width: 1025px) {
    .topbar-hamburger { display: none; }
}

.topbar-logo-mobile { display: flex; align-items: center; font-size: 22px; }

@media (min-width: 1025px) {
    .topbar-logo-mobile { display: none; }
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--mint-light), #D1FAE5);
    border: 2px solid var(--mint);
    border-radius: 60px;
    color: #065F46;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}

.topbar-icon-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text);
}

.topbar-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--coral);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 60px;
    min-width: 16px;
    text-align: center;
    border: 2px solid white;
}

.topbar-profile { position: relative; }

.topbar-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    color: white;
    font-weight: 800;
    font-size: 13px;
    border: 2px solid white;
    box-shadow: 0 3px 0 rgba(255,107,107,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: white;
    border: 3px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s var(--bounce);
    overflow: hidden;
    z-index: 200;
}
.profile-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }

.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-gradient);
}

.profile-menu-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid white;
}

.profile-menu-name {
    font-size: 13px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-menu-email {
    font-size: 11px; color: var(--text-light);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.profile-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}
.profile-menu-item:hover { background: var(--bg); color: var(--coral); }
.profile-menu-item.logout { color: var(--coral); }

/* ============================================
   DASH CONTENT
   ============================================ */
.dash-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.dash-page-title {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.dash-page-sub {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 20px;
    font-weight: 500;
}

.dash-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 3px solid #ffffff;
    margin-bottom: 18px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s var(--bounce);
    width: 100%;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.dash-card-title { font-size: 16px; font-weight: 800; color: var(--text); }

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 3px solid #ffffff;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--bounce);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--coral), var(--yellow));
}
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--turquoise), var(--mint)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--lavender), var(--coral)); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--yellow), var(--mint)); }

.stat-card:hover { transform: translateY(-4px); }

.stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }

.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid white;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
.stat-card-icon.coral { background: linear-gradient(135deg, var(--coral), var(--coral-dark)); }
.stat-card-icon.turquoise { background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark)); }
.stat-card-icon.yellow { background: linear-gradient(135deg, var(--yellow), var(--yellow-dark)); }
.stat-card-icon.lavender { background: linear-gradient(135deg, var(--lavender), var(--lavender-dark)); }
.stat-card-icon.mint { background: linear-gradient(135deg, var(--mint), var(--mint-dark)); }

.stat-card-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card-label { font-size: 12px; color: var(--text-light); font-weight: 600; }

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border-top: 3px solid var(--border);
    z-index: 500;
    padding: 6px 4px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
    position: relative;
    min-width: 0;
}

.bottom-nav-item.active { color: var(--coral); }
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--coral);
    border-radius: 0 0 6px 6px;
}

.bottom-nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav-label {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
    z-index: 9999;
    transition: transform 0.5s var(--bounce);
    border: 3px solid #ffffff;
    color: white;
    max-width: calc(100% - 24px);
    text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1024px) {
    .toast { bottom: calc(var(--bottomnav-height) + 16px); }
}

.toast-success { background: linear-gradient(135deg, var(--mint), var(--mint-dark)); }
.toast-error { background: linear-gradient(135deg, var(--coral), var(--coral-dark)); }
.toast-info { background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark)); }

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 640px) {
    .auth-wrapper { padding: 8px; }
    .auth-card { padding: 20px 18px; border-radius: var(--radius-lg); max-width: 100%; }
    .auth-logo { font-size: 17px; margin-bottom: 12px; }
    .auth-logo .logo-icon { width: 36px; height: 36px; font-size: 17px; border-radius: 11px; }
    .auth-header { margin-bottom: 12px; }
    .auth-header h1 { font-size: 19px; }
    .auth-header p { font-size: 11px; }
    
    .form-group { margin-bottom: 10px; }
    .form-label { font-size: 11px; margin-bottom: 4px; }
    .form-input { padding: 10px 12px 10px 38px; font-size: 13px; }
    .input-icon { left: 12px; font-size: 14px; }
    .password-toggle { width: 26px; height: 26px; right: 8px; font-size: 10px; }
    
    .btn { padding: 10px 16px; font-size: 12px; }
    .btn-block { padding: 11px 16px; font-size: 13px; }
    .form-checkbox { font-size: 10px; margin-bottom: 10px; }
    .form-checkbox input[type="checkbox"] { width: 14px; height: 14px; }
    .auth-link { font-size: 11px; margin-top: 10px; }
    .auth-divider { margin: 10px 0; font-size: 9px; }
    .alert { padding: 8px 10px; font-size: 11px; }
    
    .dash-content {
        padding: 16px 12px;
        padding-bottom: calc(var(--bottomnav-height) + 20px);
    }
    
    .dash-page-title { font-size: 20px; }
    .dash-page-sub { font-size: 12px; margin-bottom: 14px; }
    
    .stats-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
    .stat-card { padding: 14px; }
    .stat-card-icon { width: 40px; height: 40px; font-size: 18px; }
    .stat-card-value { font-size: 22px; }
    .stat-card-label { font-size: 11px; }
    
    .dash-card { padding: 14px 12px; margin-bottom: 12px; }
    .dash-card-title { font-size: 14px; }
    
    body::before, body::after { width: 180px; height: 180px; filter: blur(60px); }
    
    .toast {
        bottom: calc(var(--bottomnav-height) + 12px);
        padding: 10px 16px;
        font-size: 11px;
    }
    
    .profile-menu { width: 240px; }
}

@media (max-width: 380px) {
    .auth-card { padding: 16px 14px; }
    .auth-logo { font-size: 15px; }
    .auth-header h1 { font-size: 17px; }
    .form-input { padding: 9px 10px 9px 34px; font-size: 12px; }
    .btn { padding: 9px 14px; font-size: 11px; }
    .btn-block { padding: 10px 14px; font-size: 12px; }
    .dash-page-title { font-size: 17px; }
    .dash-content { padding: 12px 10px; padding-bottom: calc(var(--bottomnav-height) + 16px); }
    .dash-card { padding: 12px 10px; }
    .stat-card-value { font-size: 20px; }
    .bottom-nav-label { font-size: 9px; }
    .bottom-nav-icon { font-size: 18px; }
}

@media (min-width: 1200px) {
    .auth-card { max-width: 440px; }
}

@media print {
    .sidebar, .topbar, .bottom-nav, body::before, body::after { display: none !important; }
    .main-wrapper { margin-left: 0 !important; width: 100% !important; }
}

/* ============================================
   CINEMATIC WELCOME POPUP
   ============================================ */

.cine-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
    font-family: 'Poppins', -apple-system, sans-serif;
    background: 
        radial-gradient(ellipse at 50% 40%, rgba(30, 64, 175, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(88, 28, 135, 0.45) 0%, transparent 60%),
        linear-gradient(180deg, #050816 0%, #0a0f2e 40%, #131b4a 70%, #1a1a5a 100%);
}
.cine-overlay.show { opacity: 1; visibility: visible; }
.cine-overlay.closing { opacity: 0; visibility: hidden; }

.cine-dots {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.cine-dot {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    animation: cineFloatUp 8s linear infinite;
}
@keyframes cineFloatUp {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

.cine-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.28) 0%, rgba(255, 215, 0, 0.12) 30%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    animation: cineGlowPulse 4s ease-in-out infinite;
}
@keyframes cineGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.cine-thunder-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0%, transparent 60%);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}
.cine-overlay.show .cine-thunder-flash {
    animation: thunderFlash 4s ease-in-out infinite;
}
@keyframes thunderFlash {
    0%, 92%, 100% { opacity: 0; }
    93% { opacity: 0.9; }
    94% { opacity: 0; }
    95% { opacity: 0.7; }
    96% { opacity: 0; }
}

.cine-hero {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: 10;
}
.cine-overlay.show .cine-hero {
    animation: cineHeroIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}
@keyframes cineHeroIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-20deg); }
    60% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(5deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

.cine-bolt-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cine-bolt-svg {
    width: 170px;
    height: 170px;
    filter: 
        drop-shadow(0 0 25px #FFD700)
        drop-shadow(0 0 50px rgba(255, 215, 0, 0.8))
        drop-shadow(0 0 100px rgba(255, 215, 0, 0.5))
        drop-shadow(0 0 150px rgba(255, 215, 0, 0.3));
    animation: cineBoltFloat 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}
@keyframes cineBoltFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-3deg); }
}

.cine-pulse-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.5);
    animation: cineSoftPulse 3s ease-out infinite;
}
.cine-pulse-circle:nth-child(2) { animation-delay: 1s; }
.cine-pulse-circle:nth-child(3) { animation-delay: 2s; }
@keyframes cineSoftPulse {
    0% { transform: scale(1); opacity: 0.9; border-color: rgba(255, 215, 0, 0.7); }
    100% { transform: scale(2.2); opacity: 0; border-color: rgba(255, 215, 0, 0); }
}

.cine-content {
    position: absolute;
    top: 73%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 15;
    width: 90%;
    max-width: 700px;
}

.cine-tag {
    display: inline-block;
    padding: 9px 26px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 60px;
    color: #FFD700;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(20px);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}
.cine-overlay.show .cine-tag {
    animation: cineFadeUp 0.7s ease-out 1.4s forwards;
}

.cine-name {
    font-size: 68px;
    font-weight: 900;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF8DC 30%, #FFD700 65%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    filter: 
        drop-shadow(0 0 35px rgba(255, 215, 0, 0.7))
        drop-shadow(0 0 70px rgba(255, 215, 0, 0.4));
}
.cine-overlay.show .cine-name {
    animation: cineNameIn 1s cubic-bezier(0.22, 1, 0.36, 1) 1.6s forwards;
}
@keyframes cineFadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cineNameIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cine-sub {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 34px;
    opacity: 0;
    transform: translateY(20px);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}
.cine-overlay.show .cine-sub {
    animation: cineFadeUp 0.7s ease-out 2s forwards;
}

.cine-btn {
    position: relative;
    display: inline-block;
    padding: 22px 62px;
    border-radius: 60px;
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 25%, #FFA500 50%, #FF8C00 100%);
    background-size: 200% 200%;
    color: #0a0f2e;
    font-family: inherit;
    font-weight: 900;
    font-size: 17px;
    letter-spacing: 3px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.55),
        0 0 60px rgba(255, 215, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -3px 0 rgba(139, 69, 19, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.cine-overlay.show .cine-btn {
    animation: cineFadeUp 0.7s ease-out 2.3s forwards,
               cineGradientShift 3s linear 3s infinite;
}
@keyframes cineGradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.cine-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 15px 40px rgba(255, 215, 0, 0.75),
        0 0 100px rgba(255, 215, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.cine-btn:active {
    transform: translateY(0) scale(0.98);
}

.cine-btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    transform: skewX(-25deg);
    animation: cineShine 3s ease-in-out infinite;
}
@keyframes cineShine {
    0% { left: -100%; }
    60%, 100% { left: 200%; }
}

.cine-skip {
    display: inline-block;
    margin: 20px auto 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 24px;
    font-family: inherit;
    letter-spacing: 1px;
    opacity: 0;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.cine-overlay.show .cine-skip {
    animation: cineFadeUp 0.6s ease-out 2.8s forwards;
}
.cine-skip:hover {
    color: white;
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.06);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}

@media (max-width: 640px) {
    .cine-bolt-wrap { width: 170px; height: 170px; }
    .cine-bolt-svg { width: 130px; height: 130px; }
    .cine-name { font-size: 46px; }
    .cine-sub { font-size: 14px; margin-bottom: 26px; }
    .cine-tag { font-size: 10px; padding: 7px 20px; letter-spacing: 4px; }
    .cine-btn { padding: 17px 44px; font-size: 14px; letter-spacing: 2px; }
    .cine-content { top: 71%; }
}

@media (max-width: 400px) {
    .cine-bolt-wrap { width: 140px; height: 140px; }
    .cine-bolt-svg { width: 105px; height: 105px; }
    .cine-name { font-size: 36px; }
    .cine-sub { font-size: 12px; }
    .cine-btn { padding: 15px 34px; font-size: 12px; }
}