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

:root {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.05);
    --accent-primary: #1a73e8;
    --accent-secondary: #1565c0;
    --accent-gradient: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --shadow-premium: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    --sidebar-bg: #0c1b33;
    --sidebar-border: rgba(255, 255, 255, 0.04);
    --sidebar-text: #8a99ad;
    --sidebar-text-active: #ffffff;
    --sidebar-item-active: #1a73e8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility - adapted for light theme card premium outline */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--shadow-premium);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.05em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    background: #ffffff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.35);
    filter: brightness(1.05);
}

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

/* Alert Styling */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Sidebar Layout System */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 20px;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.sidebar-brand svg {
    color: #38bdf8; /* cyan snowflake */
}

.sidebar-brand h2 {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item svg {
    color: var(--sidebar-text);
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item:hover svg {
    color: var(--sidebar-text-active);
}

.nav-item.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-item-active);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--sidebar-text-active);
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding-top: 20px;
    margin-top: 15px;
}

.dashboard-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* User Badge & Button Utilities */
.user-badge {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--sidebar-border);
    font-weight: 500;
    color: var(--sidebar-text);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: auto;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    box-shadow: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--sidebar-text-active);
    color: var(--sidebar-text-active);
}

/* Responsive Sidebar overrides */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
        padding: 20px 15px;
    }
    .sidebar-brand {
        margin-bottom: 15px;
        justify-content: center;
    }
    .sidebar-nav {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 10px;
    }
    .nav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .sidebar-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        margin-top: 0;
        padding-top: 15px;
    }
    .sidebar-footer .user-badge {
        margin-bottom: 0 !important;
    }
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 24px;
    flex: 1;
    width: 100%;
    animation: fadeIn 0.5s ease-out forwards;
}

.welcome-banner {
    margin-bottom: 30px;
}

.welcome-banner h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.stat-card {
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
}

.stat-card-icon-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stat card custom icon colors */
.icon-blue {
    background: rgba(26, 115, 232, 0.08);
    color: #1a73e8;
}
.icon-orange {
    background: rgba(249, 115, 22, 0.08);
    color: #f97316;
}
.icon-green {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}
.icon-purple {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Two-column Sections Grid */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

.section-panel {
    padding: 24px;
    border-radius: 12px;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

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

.data-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-info {
    background: rgba(26, 115, 232, 0.08);
    color: #1a73e8;
    border: 1px solid rgba(26, 115, 232, 0.15);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Connection Test widget */
.connection-test-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-online {
    background-color: var(--success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.dot-offline {
    background-color: var(--error);
    box-shadow: 0 0 10px rgba(239, 104, 104, 0.3);
}

/* Chart Styles */
.chart-container {
    position: relative;
    width: 100%;
    height: 220px;
}

.chart-axis-line {
    stroke: rgba(0, 0, 0, 0.06);
    stroke-width: 1;
}

.chart-grid-line {
    stroke: rgba(0, 0, 0, 0.04);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.chart-label {
    fill: var(--text-secondary);
    font-size: 0.75rem;
    font-family: inherit;
}

.chart-bar {
    fill: var(--accent-primary);
    rx: 4;
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.chart-bar:hover {
    fill: var(--accent-secondary);
    opacity: 0.9;
}

.chart-line {
    stroke: var(--accent-primary);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}

.chart-area-fill {
    fill: url(#chart-gradient);
    opacity: 0.08;
}

.chart-point {
    fill: #ffffff;
    stroke: var(--accent-primary);
    stroke-width: 3;
    cursor: pointer;
    transition: r 0.2s ease, fill 0.2s ease;
}

.chart-point:hover {
    r: 6;
    fill: var(--accent-primary);
}

/* Footer */
.footer {
    padding: 30px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
    background: #ffffff;
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-link:hover:not(.disabled) {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pagination-link.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    cursor: default;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Action Icon Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.action-btn.edit-btn {
    color: var(--accent-primary);
    background: rgba(26, 115, 232, 0.08);
}

.action-btn.edit-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

.action-btn.delete-btn {
    color: var(--error);
    background: rgba(239, 68, 68, 0.08);
}

.action-btn.delete-btn:hover {
    background: var(--error);
    color: #ffffff;
}

/* Modal Dialog Overlay & Layout */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: backdropFadeIn 0.25s ease forwards;
}

.modal-card {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-x {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: inline-flex;
}

.modal-close-x:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Help Center Styles */
.brand-tab-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-tab-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.brand-tab-btn.active {
    background: var(--brand-color, var(--accent-primary));
    border-color: var(--brand-color, var(--accent-primary));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.error-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.error-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.error-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding-bottom: 10px;
}

.error-code-badge {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    color: #ffffff;
    background: var(--brand-color, var(--accent-primary));
}

.error-brand-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.error-desc {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.error-detail-item {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.error-detail-item strong {
    color: var(--text-primary);
}

/* Accordion FAQ Styles */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.accordion-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.accordion-header-icon {
    transition: transform 0.25s ease;
    color: var(--text-secondary);
}

.accordion-item.active .accordion-header-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease;
    padding: 0 20px;
    border-top: 1px solid transparent;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: 16px 20px;
    border-top-color: rgba(0, 0, 0, 0.04);
}


