/* ============================================================
   Stormace Admin — Custom Styles
   Matches app design language:
     Primary:   #FF6B6B (coral red)
     Secondary: #4ECDC4 (teal)
     Accent:    #FFE66D (gold)
     Dark BG:   #1A1A2E
     Surface:   #16162A
     Card:      #1E1E3A
   ============================================================ */

/* --- Global --- */
body {
    background: #121225;
    font-family: 'Inter', sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #121225;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Card Styling --- */
.mud-card {
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mud-card:hover {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- Metric Cards --- */
.metric-card {
    position: relative;
    overflow: hidden;
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}
.metric-card.accent-primary::before {
    background: linear-gradient(90deg, #FF6B6B, #FF8E8E);
}
.metric-card.accent-secondary::before {
    background: linear-gradient(90deg, #4ECDC4, #6FE7DF);
}
.metric-card.accent-gold::before {
    background: linear-gradient(90deg, #FFE66D, #FFD93D);
}
.metric-card.accent-purple::before {
    background: linear-gradient(90deg, #A78BFA, #C4B5FD);
}
.metric-card.accent-blue::before {
    background: linear-gradient(90deg, #64B5F6, #90CAF9);
}
.metric-card.accent-green::before {
    background: linear-gradient(90deg, #81C784, #A5D6A7);
}
.metric-card.accent-orange::before {
    background: linear-gradient(90deg, #FFB74D, #FFCC80);
}
.metric-card.accent-red::before {
    background: linear-gradient(90deg, #E57373, #EF9A9A);
}

.metric-card .metric-icon {
    opacity: 0.08;
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 56px !important;
}

.metric-card .metric-value {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- Appbar --- */
.mud-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.appbar-gradient-line {
    height: 2px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #FFE66D);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* --- Drawer / Nav --- */
.mud-drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.mud-nav-link.active {
    background: rgba(255, 107, 107, 0.1) !important;
    border-left: 3px solid #FF6B6B;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 8px;
}
.nav-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}
.nav-brand-text {
    font-weight: 600;
    font-size: 15px;
    color: #E0E0E0;
    letter-spacing: 0.5px;
}

/* --- Login Page --- */
.login-bg {
    min-height: 100vh;
    background: #121225;
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.08) 0%, transparent 70%);
}
.login-bg::after {
    content: '';
    position: absolute;
    bottom: -200px;
    left: -200px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.06) 0%, transparent 70%);
}
.login-card {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(10px);
    max-width: 420px;
    width: 100%;
}
.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.login-logo .mud-icon-root {
    font-size: 28px !important;
    color: white;
}
.btn-gradient {
    background: linear-gradient(135deg, #FF6B6B, #E85D5D) !important;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}
.btn-gradient:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
    transform: translateY(-1px);
}

/* --- Paper/Filter bar --- */
.mud-paper {
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
}

/* --- Tables --- */
.mud-table-container {
    border-radius: 12px !important;
}
.mud-table .mud-table-head .mud-table-row .mud-table-cell {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mud-table .mud-table-body .mud-table-row:hover {
    background: rgba(255, 107, 107, 0.04) !important;
}

/* --- Chips --- */
.mud-chip {
    border-radius: 8px !important;
    font-weight: 500 !important;
}

/* --- Tabs --- */
.mud-tabs .mud-tab.mud-tab-active {
    color: #FF6B6B !important;
}
.mud-tabs-toolbar-content .mud-tab-slider {
    background: #FF6B6B !important;
}

/* --- Section Headers --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.section-header .mud-icon-root {
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px !important;
}
.section-header .mud-typography {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* --- Chart containers --- */
.chart-card .mud-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* --- Status dots --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.online {
    background: #81C784;
    box-shadow: 0 0 6px rgba(129, 199, 132, 0.5);
}
.status-dot.offline {
    background: rgba(255, 255, 255, 0.2);
}

/* --- MudAlert --- */
.mud-alert {
    border-radius: 10px !important;
}

/* --- Progress Linear --- */
.mud-progress-linear {
    border-radius: 4px !important;
}

/* --- Page title styling --- */
.page-title {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- Chat Bubbles --- */
.chat-row          { display: flex; margin-bottom: 8px; }
.chat-row-user     { justify-content: flex-end; }
.chat-row-admin    { justify-content: flex-start; }

.chat-bubble       { max-width: 75%; padding: 12px 16px; position: relative; }
.chat-bubble-user  { background: rgba(255,107,107,0.12); border-radius: 16px 16px 4px 16px; }
.chat-bubble-admin { background: rgba(78,205,196,0.10); border-radius: 16px 16px 16px 4px; }

.chat-sender       { font-size: 11px; font-weight: 600; margin-bottom: 2px; padding: 0 4px; }
.chat-sender-user  { text-align: right; color: rgba(255,255,255,0.5); }
.chat-sender-admin { text-align: left; color: #4ECDC4; }

.chat-time         { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 6px; }
.chat-time-user    { text-align: right; }
.chat-time-admin   { text-align: left; }

.chat-input-bar    { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,0.08); }

/* --- Responsive tweaks --- */
@media (max-width: 960px) {
    .metric-card .metric-icon {
        font-size: 40px !important;
    }
}
