/* ===================================================
   UNHAS FAST — Premium Design System v2
   Dark Sidebar · Light Content · Refined Animations
   =================================================== */

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

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Brand — Rich Purple */
    --brand-50:  #f5f0ff;
    --brand-100: #ede0ff;
    --brand-200: #dab8ff;
    --brand-300: #bf86ff;
    --brand-400: #a855f7;
    --brand-500: #9333ea;
    --brand-600: #7c22ce;
    --brand-700: #6b21a8;
    --brand-800: #581c87;
    --brand-900: #3b0764;

    /* Accent — Hot Pink for prices/highlights */
    --accent-400: #f472b6;
    --accent-500: #ec4899;
    --accent-600: #db2777;

    /* Sidebar — Deep Purple Dark */
    --sidebar-bg:          #16102a;
    --sidebar-bg-2:        #1e1640;
    --sidebar-border:      rgba(168, 85, 247, 0.12);
    --sidebar-text:        rgba(255,255,255,0.82);
    --sidebar-text-hover:  rgba(255,255,255,0.90);
    --sidebar-active-bg:   rgba(147,51,234,0.22);
    --sidebar-active-text: #c084fc;
    --sidebar-divider:     rgba(255,255,255,0.08);
    --sidebar-icon-muted:  rgba(255,255,255,0.55);

    /* Content Background */
    --bg-page:   #e2e0eb;
    --bg-card:   #ffffff;
    --bg-input:  #ffffff;

    /* Neutral */
    --gray-50:  #fafaf9;
    --gray-100: #f4f3f7;
    --gray-200: #e8e5f0;
    --gray-300: #d4cfe0;
    --gray-400: #a89ec0;
    --gray-500: #7b72a0;
    --gray-600: #5a5278;
    --gray-700: #3d3660;
    --gray-800: #241f3a;
    --gray-900: #13102a;

    /* Status */
    --success-50:  #f0fdf4; --success-500: #22c55e; --success-600: #16a34a;
    --warning-50:  #fffbeb; --warning-500: #f59e0b; --warning-600: #d97706;
    --error-50:    #fef2f2; --error-500:   #ef4444; --error-600:   #dc2626;

    /* Shadows — Purple-tinted */
    --shadow-xs: 0 1px 2px rgba(147,51,234,0.04);
    --shadow-sm: 0 1px 3px rgba(147,51,234,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(147,51,234,0.10), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(147,51,234,0.12), 0 4px 8px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 50px rgba(147,51,234,0.15), 0 8px 16px rgba(0,0,0,0.06);

    /* Radius */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition:      200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(147,51,234,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(147,51,234,0); }
    100% { box-shadow: 0 0 0 0 rgba(147,51,234,0); }
}

/* Staggered animation classes */
.animate-fade  { animation: fadeIn var(--transition-slow) both; }
.animate-up    { animation: slideUp var(--transition-slow) both; }
.animate-in    { animation: slideIn var(--transition-slow) both; }
.animate-scale { animation: scaleIn var(--transition-slow) both; }

.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }
.delay-6 { animation-delay: 300ms; }

/* =====================================================
   BASE TYPOGRAPHY
   ===================================================== */
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

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

/* =====================================================
   SIDEBAR — Dark Purple Premium
   ===================================================== */
.sidebar {
    width: 248px;
    background: var(--sidebar-bg);
    background-image: radial-gradient(ellipse at top left, rgba(147,51,234,0.15) 0%, transparent 60%),
                      radial-gradient(ellipse at bottom right, rgba(236,72,153,0.08) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
}

/* Subtle shine line at top */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168,85,247,0.5), transparent);
}

.sidebar-logo {
    padding: 1.75rem 1.5rem 1.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168,85,247,0.45), rgba(236,72,153,0.22), transparent);
}

.sidebar-logo-img {
    height: 62px;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0 0.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(147,51,234,0.3) transparent;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0 0.875rem;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.6875rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--transition);
    position: relative;
    letter-spacing: 0.01em;
}

.sidebar-nav a:hover {
    background: rgba(168,85,247,0.14);
    color: var(--sidebar-text-hover);
    box-shadow: inset 0 0 0 1px rgba(168,85,247,0.12);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(147,51,234,0.32) 0%, rgba(147,51,234,0.15) 100%);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: 0 2px 14px rgba(147,51,234,0.18), inset 0 0 0 1px rgba(147,51,234,0.24);
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: linear-gradient(180deg, #c084fc, #a855f7);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(168,85,247,0.75);
}

.sidebar-nav svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity var(--transition);
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
    opacity: 1;
}

.sidebar-divider {
    margin: 1.125rem 1.25rem 0.375rem;
    color: rgba(255,255,255,0.2);
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar-divider::before {
    content: '';
    display: block;
    height: 1px;
    flex: 1;
    background: var(--sidebar-divider);
}

.sidebar-separator {
    height: 1px;
    background: var(--sidebar-divider);
    margin: 0.5rem 0.75rem;
    list-style: none;
}

/* User card at bottom of sidebar */
.sidebar-user {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem 1rem;
    margin: 0 0.75rem 0.75rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-user-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(239,68,68,0.08);
    color: rgba(255,100,100,0.7);
    text-decoration: none;
    transition: all var(--transition);
    flex-shrink: 0;
    border: 1px solid rgba(239,68,68,0.15);
}

.sidebar-logout-btn:hover {
    background: rgba(239,68,68,0.22);
    color: rgba(255,140,140,1);
    border-color: rgba(239,68,68,0.3);
}

.sidebar-logout-btn svg {
    width: 15px;
    height: 15px;
    opacity: 1 !important;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: 248px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
}

.main-header {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(147,51,234,0.07);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 0 rgba(147,51,234,0.05);
}

.main-header h1 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.01em;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-email {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
}

.user-role {
    font-size: 0.625rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-bounce);
    box-shadow: 0 2px 8px rgba(147,51,234,0.35);
}

.user-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(147,51,234,0.45);
}

/* =====================================================
   CONTENT AREA
   ===================================================== */
.content {
    flex: 1;
    padding: 1.75rem 2rem;
    width: 100%;
    animation: slideUp 0.35s cubic-bezier(0.4,0,0.2,1) both;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}

.content-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.content-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5625rem 1.125rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: white;
    box-shadow: 0 2px 8px rgba(147,51,234,0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    box-shadow: 0 4px 16px rgba(147,51,234,0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: rgba(239,68,68,0.07);
    color: var(--error-600);
    border: 1.5px solid rgba(239,68,68,0.2);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.13);
    border-color: rgba(239,68,68,0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--brand-500);
    border: 1.5px solid rgba(147,51,234,0.25);
}

.btn-ghost:hover {
    background: var(--brand-50);
    border-color: var(--brand-300);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
}

.btn-icon:hover { transform: scale(1.08); }

.btn-icon-brand { color: var(--brand-500); }
.btn-icon-brand:hover { background: var(--brand-50); border-color: var(--brand-200); }

.btn-icon-gray { color: var(--gray-400); }
.btn-icon-gray:hover { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }

.btn-icon-red { color: var(--error-500); }
.btn-icon-red:hover { background: var(--error-50); border-color: #fecaca; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.375rem;
    box-shadow: 0 1px 3px rgba(147,51,234,0.06), 0 4px 16px rgba(147,51,234,0.04);
    border: 1px solid rgba(147,51,234,0.07);
    margin-bottom: 1rem;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: 0 2px 8px rgba(147,51,234,0.10), 0 8px 24px rgba(147,51,234,0.07);
    border-color: rgba(147,51,234,0.13);
    transform: translateY(-1px);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Card with colored top border accent */
.card-accent-purple { border-top: 3px solid var(--brand-500); }
.card-accent-pink   { border-top: 3px solid var(--accent-500); }
.card-accent-green  { border-top: 3px solid var(--success-500); }

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.375rem;
    border: 1px solid rgba(147,51,234,0.07);
    box-shadow: 0 1px 3px rgba(147,51,234,0.06), 0 4px 12px rgba(147,51,234,0.03);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-400), var(--accent-500));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.stat-card:hover {
    border-color: rgba(147,51,234,0.15);
    box-shadow: 0 4px 16px rgba(147,51,234,0.12);
    transform: translateY(-2px);
}

.stat-card:hover::after {
    transform: scaleX(1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.875rem;
}

.stat-title {
    font-size: 0.6875rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon-brand  { background: var(--brand-50); color: var(--brand-500); }
.stat-icon-purple { background: linear-gradient(135deg,#f0e6ff,#e4ccff); color: var(--brand-600); }
.stat-icon-pink   { background: linear-gradient(135deg,#fde6f5,#fbc9e9); color: var(--accent-600); }
.stat-icon-gold   { background: var(--warning-50); color: var(--warning-600); }
.stat-icon-green  { background: var(--success-50); color: var(--success-600); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.375rem;
}

.stat-link {
    font-size: 0.8125rem;
    color: var(--brand-500);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    transition: color var(--transition);
}

.stat-link:hover { color: var(--brand-600); }

/* =====================================================
   TABLES
   ===================================================== */
.table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(147,51,234,0.07);
    box-shadow: 0 1px 3px rgba(147,51,234,0.05), 0 4px 12px rgba(147,51,234,0.03);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.875rem 1rem;
    text-align: left;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

table td {
    padding: 0.9375rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid rgba(147,51,234,0.04);
    transition: background var(--transition);
}

table tr:hover td {
    background: rgba(147,51,234,0.03);
}

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

table tbody tr {
    transition: all var(--transition);
}

/* =====================================================
   LIST ITEMS
   ===================================================== */
.list-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-100);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.list-item:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.list-item-content { flex: 1; }

.list-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-item-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
    display: flex;
    gap: 0.75rem;
}

.list-item-actions {
    display: flex;
    gap: 0.25rem;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-success  { background: #dcfce7; color: #15803d; }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }
.badge-brand    { background: var(--brand-50); color: var(--brand-700); }
.badge-pink     { background: #fce7f3; color: #be185d; }
.badge-purple   { background: var(--brand-50); color: var(--brand-700); }
.badge-gold     { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: var(--error-600); }

/* Dot badge */
.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: 1.375rem; }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4375rem;
    letter-spacing: 0.01em;
}

.form-label span.required { color: var(--accent-500); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--bg-input);
    transition: all var(--transition);
    outline: none;
    line-height: 1.5;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--gray-300);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(147,51,234,0.12);
}

.form-input::placeholder { color: var(--gray-300); }
.form-textarea { min-height: 100px; resize: vertical; }

.form-help {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.3rem;
}

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

/* Toggle */
.toggle-checkbox {
    width: 44px;
    height: 24px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition);
    outline: none;
    flex-shrink: 0;
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-bounce);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-checkbox:checked { background: var(--brand-500); }
.toggle-checkbox:checked::before { transform: translateX(20px); }

/* =====================================================
   ALERTS & TOASTS
   ===================================================== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideUp 0.3s both;
}

.alert svg { width: 16px; height: 16px; flex-shrink: 0; }

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: var(--error-600); border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200); }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    animation: fadeIn 0.4s both;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-400);
    box-shadow: 0 4px 16px rgba(147,51,234,0.12);
}

.empty-state-icon svg { width: 32px; height: 32px; }

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   BACK LINK
   ===================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    transition: all var(--transition);
    padding: 0.25rem 0;
}

.back-link:hover {
    color: var(--brand-500);
    gap: 0.5rem;
}

.back-link svg { width: 16px; height: 16px; }

/* =====================================================
   DETAIL PAGE GRID (org/agent detail)
   ===================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--gray-800);
    font-weight: 500;
}

/* =====================================================
   PROMO PRICE STYLES
   ===================================================== */
.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
    box-shadow: 0 2px 6px rgba(236,72,153,0.3);
}

.promo-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-600);
    letter-spacing: -0.02em;
}

.promo-original-price {
    font-size: 0.8125rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.promo-discount {
    display: inline-flex;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(236,72,153,0.1));
    color: var(--brand-600);
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* =====================================================
   SECTION HEADER ICONS (golden/colored icons in forms)
   ===================================================== */
.section-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.section-icon-purple { background: var(--brand-50); }
.section-icon-pink   { background: #fce7f3; }
.section-icon-gold   { background: var(--warning-50); }
.section-icon-green  { background: var(--success-50); }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-900) 0%, #1a0b3d 50%, var(--brand-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Background noise texture effect */
.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.25) 0%, transparent 50%),
                      radial-gradient(ellipse at 20% 80%, rgba(236,72,153,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-logo-img {
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(147,51,234,0.3));
}

.login-title {
    font-size: 1.375rem;
    font-weight: 800;
    text-align: center;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.875rem;
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.75rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.login-footer a {
    color: var(--brand-500);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover { color: var(--brand-600); text-decoration: underline; }

.login-copyright {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    position: relative;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    padding: 1rem 1.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
}

/* =====================================================
   QUICK ACTION CARDS (org detail sidebar)
   ===================================================== */
.quick-action {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.quick-action:hover {
    border-color: var(--brand-300);
    box-shadow: 0 4px 12px rgba(147,51,234,0.1);
    transform: translateX(3px);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.quick-action-text h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.quick-action-text p {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* =====================================================
   CHART AREA
   ===================================================== */
.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.375rem;
    border: 1px solid rgba(147,51,234,0.07);
    box-shadow: 0 1px 3px rgba(147,51,234,0.05);
}

.chart-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =====================================================
   ACTIVITY FEED
   ===================================================== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-300);
    margin-top: 0.375rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(147,51,234,0.1);
}

.activity-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    flex: 1;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* =====================================================
   THUMBNAIL (service/promo images in tables)
   ===================================================== */
.thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
    border: 1.5px solid rgba(147,51,234,0.08);
}

.thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-300);
    flex-shrink: 0;
    font-size: 1.25rem;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(19,16,42,0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s both;
}

.modal-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(147,51,234,0.08);
    animation: scaleIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-brand   { color: var(--brand-500); }
.text-accent  { color: var(--accent-500); }
.text-success { color: var(--success-600); }
.text-error   { color: var(--error-500); }
.text-gray    { color: var(--gray-500); }
.text-muted   { color: var(--gray-400); }
.text-bold    { font-weight: 700; }
.bg-brand-50  { background: var(--brand-50); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content { padding: 1.25rem; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-title { font-size: 1.25rem; }
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

.sidebar::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.25); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(168,85,247,0.4); }

/* =====================================================
   REDUCE MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
