/* =========================================
   GiBOT Dashboard - Core Styling
   Premium Black, White, & Green Aesthetic
   ========================================= */

/* Variables */
:root {
    /* Brand Colors - Black, White, Green Palette */
    --primary: #10b981;
    /* Emerald Green */
    --primary-light: #34d399;
    --primary-dark: #059669;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Theme Independent Sizing & Borders */
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --font-family: 'Outfit', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables (Default) */
.light-theme {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.9);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --glass-border: rgba(0, 0, 0, 0.05);

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05);

    --nav-active-bg: rgba(16, 185, 129, 0.1);
    --input-bg: #f1f5f9;
}

/* Dark Theme Variables */
.dark-theme {
    --bg-base: #0f172a;
    /* Slate 900 / Near Black */
    --bg-surface: #1e293b;
    /* Slate 800 */
    --bg-surface-hover: #334155;
    --bg-header: rgba(15, 23, 42, 0.9);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #334155;
    --glass-border: rgba(255, 255, 255, 0.08);

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.6);

    --nav-active-bg: rgba(16, 185, 129, 0.2);
    --input-bg: rgba(255, 255, 255, 0.05);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

/* =========================================
   Layout Containers
   ========================================= */
.container-xl {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utility Layouts */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* =========================================
   Glassmorphism Utilities / Cards
   ========================================= */
.glass-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

/* =========================================
   Top Navigation Header
   ========================================= */
.topbar {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 38px;
    width: auto;
    display: block;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

.nav-item {
    height: 100%;
}

.nav-item > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 100%;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.nav-item.active > a {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--nav-active-bg);
}

.nav-icon {
    font-size: 1.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-links-menu {
    padding: 0.45rem;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.92rem;
    font-weight: 600;
}

.quick-link-item i {
    width: 18px;
    font-size: 1.08rem;
    color: var(--primary);
    opacity: 0.95;
    flex-shrink: 0;
}

.quick-link-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    width: 250px;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.action-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.theme-toggle-btn:hover {
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-header);
}

.user-profile {
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.user-profile:hover .profile-img {
    border-color: var(--primary);
}

/* =========================================
   Buttons & General UI
   ========================================= */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary-dark);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: white;
    /* Protect against generic a:hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-muted);
}

.btn-google {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-google i {
    color: #ea4335;
    font-size: 1.2rem;
}

.btn-google:hover {
    border-color: var(--primary);
    background: var(--nav-active-bg);
}

/* =========================================
   Dashboard Main Content
   ========================================= */
.main-content {
    padding: 2rem 0 4rem 0;
}

.public-notices-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.public-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.public-notice-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.public-notice-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.public-notice.is-info {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.08);
}

.public-notice.is-info .public-notice-label {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.public-notice.is-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.08);
}

.public-notice.is-warning .public-notice-label {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.public-notice.is-error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

.public-notice.is-error .public-notice-label {
    background: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* =========================================
   Stats Grid
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.stat-icon-wrapper.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.trend {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
}

.trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-body h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-value .decimals {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================
   Dashboard Middle Grid
   ========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

/* Chart Area */
.chart-section {
    padding: 1.5rem;
}

.chart-container {
    height: 300px;
    width: 100%;
}

/* Recent Activities / Status Lists */
.recent-activities {
    padding: 1.5rem;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    position: relative;
}

.status-indicator.online {
    background: var(--success);
}

.status-indicator.warning {
    background: var(--warning);
}

.status-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: var(--text-primary);
}

.status-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Quick Actions Grid */
.quick-integrations h3 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.action-card {
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.action-card i {
    font-size: 1.25rem;
}

.action-card span {
    font-size: 0.8rem;
    font-weight: 500;
}

.action-card:hover {
    background: var(--nav-active-bg);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.dark-theme .action-card:hover {
    color: var(--primary-light);
}

/* =========================================
   Filter Bar (Orders & Invoices)
   ========================================= */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-end;
    padding: 1rem;
}

.filter-item {
    flex: 1;
    min-width: 220px;
}

.filter-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: block;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-item.flex-2 {
    flex: 2;
    min-width: 320px;
}

/* Base input for filter bar */
.filter-bar .full-width-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Select element styling */
.filter-bar select.full-width-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
}

.filter-bar select.full-width-input:hover {
    border-color: var(--text-muted);
}

.filter-bar select.full-width-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Search input with icon styling */
.filter-bar .input-with-icon {
    position: relative;
    width: 100%;
}

.filter-bar .input-with-icon i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.filter-bar .input-with-icon input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.9rem 1.25rem 0.9rem 3.25rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.filter-bar .input-with-icon input:hover {
    background: var(--bg-surface-hover);
}

.filter-bar .input-with-icon input:focus {
    outline: none;
    background: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* =========================================
   Settings Grid Layout
   ========================================= */
.settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.settings-nav {
    padding: 1.5rem 0;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.settings-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.settings-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.settings-menu li a i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.settings-menu li:hover a {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.settings-menu li:hover a i {
    color: var(--primary-light);
}

.settings-menu li.active a {
    background: var(--nav-active-bg);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.settings-menu li.active a i {
    color: var(--primary);
}

.store-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.store-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition-fast);
}

.store-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.store-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.store-logo-hub {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.store-logo-hub.channel-trendyol {
    color: #f27a1a;
    background: rgba(242, 122, 26, 0.1);
    border-color: rgba(242, 122, 26, 0.2);
}

.store-logo-hub.channel-hepsiburada {
    color: #ea580c;
    background: rgba(234, 88, 12, 0.1);
    border-color: rgba(234, 88, 12, 0.2);
}

.store-card-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.recent-invoices {
    padding: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

/* Badges for table */
.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
}

.channel-trendyol {
    color: #f27a1a;
}

.channel-hepsiburada {
    color: #ea580c;
}

.channel-n11 {
    color: #7c3aed;
}

.channel-amazon {
    color: #d97706;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.icon-btn.primary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

/* =========================================
   Authentication Pages Specific Styles
   ========================================= */
.auth-page {
    height: 100vh;
    overflow: hidden;
    /* Hide scroll for split screen */
    display: flex;
}

.auth-theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
}

.auth-container {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

.auth-container.reverse {
    flex-direction: row-reverse;
}

/* Fix narrow container for forgot & reset password */
.auth-container.narrow {
    max-width: 500px;
    margin: 0 auto;
    align-items: center;
}

.auth-container.narrow .auth-form-side {
    padding: 1rem;
    align-items: center;
}

/* Brand Side */
.auth-brand-side {
    flex: 1;
    background: var(--bg-surface-hover);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.auth-container.reverse .auth-brand-side {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.auth-brand-side.accent-bg {
    background: var(--nav-active-bg);
}

.auth-brand-content {
    position: relative;
    z-index: 10;
    max-width: 500px;
}

.auth-logo {
    margin-bottom: 2rem;
}

.auth-logo-image {
    height: 56px;
    width: auto;
    display: block;
}

.auth-logo-image-centered {
    height: 50px;
}

.center-logo {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.auth-brand-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.feature-item i {
    color: var(--primary);
    font-size: 1.5rem;
}

.auth-stats-preview {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.stat-bubble {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-soft);
}

.stat-bubble i {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Abstract shapes for auth brand side */
.auth-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.4;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--primary);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--info);
}

.shape-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: var(--primary);
    opacity: 0.15;
}

/* Form Side */
.auth-form-side {
    flex: 1;
    background: var(--bg-surface);
    /* Integrated sleek look */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

/* Safe vertical centering that doesn't clip top content on short screens */
.auth-form-side::before,
.auth-form-side::after {
    content: "";
    flex: 1;
    min-height: 2rem;
    /* Add breathing room when overflowing */
}

.full-width {
    width: 100%;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
    flex: none;
    padding: 1rem 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.register-wrapper {
    max-width: 460px;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i:first-child {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.input-with-icon.empty-icon input {
    padding-left: 1rem;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: var(--bg-surface);
}

.input-with-icon input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 3px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

.terms-group label {
    font-size: 0.85rem;
}

.terms-group {
    align-items: flex-start;
    gap: 0.65rem;
}

.terms-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 5px;
    margin-top: 2px;
    flex-shrink: 0;
}

.terms-group input[type="checkbox"]:checked::after {
    top: 1px;
    left: 5px;
    width: 4px;
    height: 8px;
}

.terms-group label a {
    color: var(--primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* =========================================
   Modals & Overlays
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-surface);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-hover);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-modal {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-surface-hover);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        width: 180px;
    }
}

@media (max-width: 980px) {
    .topbar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        z-index: 1100;
    }

    .header-inner {
        gap: 0.5rem;
        min-width: 0;
    }

    .logo {
        min-width: 0;
        overflow: hidden;
    }

    .logo-image {
        height: 30px;
        max-width: 118px;
    }

    .header-actions {
        margin-left: auto;
        gap: 0.45rem;
        flex-shrink: 0;
        display: flex !important;
        position: relative;
        z-index: 1102;
    }

    .search-box {
        display: none !important;
    }

    .action-btn {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }

    .nav-links {
        display: flex;
        position: fixed !important;
        inset: auto 0 0 0;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        margin: 0;
        padding: 0;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        height: 65px;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dark-theme .nav-links {
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    }

    .nav-item {
        margin: 0;
        flex: 1;
        text-align: center;
        min-width: 72px;
    }

    .nav-item > a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0;
        font-size: 0.7rem;
        font-weight: 500;
        gap: 0.2rem;
        border-radius: 0;
        color: var(--text-muted);
    }

    .nav-item > a::before {
        display: none;
    }

    .nav-item.active > a {
        color: var(--primary);
        background: transparent;
    }

    .nav-item.active > a .nav-icon {
        color: var(--primary);
    }

    .nav-icon {
        font-size: 1.4rem;
        margin: 0;
    }
}

@media (max-width: 768px) {

    /* Layout Spacing Adjustments */
    .container-xl {
        padding: 0 1rem;
    }

    .header-inner {
        gap: 0.5rem;
        min-width: 0;
    }

    .header-actions {
        gap: 0.5rem;
        margin-left: auto;
        flex-shrink: 0;
    }

    .logo {
        min-width: 0;
    }

    .action-btn {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }

    .dashboard-content {
        padding: 1.5rem 1rem;
    }

    .main-content {
        padding-bottom: 6rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .page-header h1 {
        font-size: 1.45rem;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .glass-panel,
    .recent-invoices,
    .table-responsive {
        min-width: 0;
    }

    .public-notice {
        align-items: flex-start;
    }

    /* Hide search box in header to save space */
    .search-box {
        display: none !important;
    }

    /* App-like Bottom Navigation for Mobile */
    .nav-links {
        display: flex;
        position: fixed !important;
        inset: auto 0 0 0;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        margin: 0;
        padding: 0;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        height: 65px;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dark-theme .nav-links {
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    }

    .nav-item {
        margin: 0;
        flex: 1;
        text-align: center;
        min-width: 72px;
    }

    .nav-item > a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0;
        font-size: 0.7rem;
        font-weight: 500;
        gap: 0.2rem;
        border-radius: 0;
        color: var(--text-muted);
    }

    .nav-item > a::before {
        display: none;
        /* Hide desktop hover line */
    }

    .nav-item.active > a {
        color: var(--primary);
        background: transparent;
    }

    .nav-item.active > a .nav-icon {
        color: var(--primary);
    }

    .nav-icon {
        font-size: 1.4rem;
        margin: 0;
    }

    #quickLinksMenu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 65px !important;
        transform: none !important;
        width: 100vw;
        max-width: 100vw !important;
        max-height: min(62vh, 520px);
        overflow-y: auto;
        z-index: 1200 !important;
        border-radius: 16px 16px 0 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        padding: 0.55rem 0.8rem !important;
        box-shadow: 0 -14px 30px rgba(15, 23, 42, 0.18) !important;
        animation: quickLinksSlideUp .22s ease-out;
    }

    .quick-links-menu {
        padding: 0.65rem 0.75rem !important;
    }

    .quick-link-item {
        padding: 0.78rem 0.72rem;
        border-radius: 12px;
        font-size: 0.95rem;
    }

    #quickLinksToggle #quickLinksChevron {
        display: none;
    }

    #notificationDropdown {
        right: -6px !important;
        min-width: 0 !important;
        width: min(92vw, 380px);
        max-width: 92vw !important;
        max-height: 72vh;
        overflow: hidden;
    }

    #userDropdownMenu {
        right: 0 !important;
        min-width: 190px !important;
        max-width: min(88vw, 260px);
    }

    /* Add bottom padding to body/footer so content isn't hidden behind bottom nav */
    .app-footer {
        margin-bottom: 75px !important;
    }

    /* Make Data Tables Horizontally Scrollable */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
    }

    .data-table {
        min-width: 800px;
        /* Force scroll if screen is smaller */
        border: none;
        /* Let the wrapper handle border on mobile */
    }

    .data-table th,
    .data-table td {
        padding: 0.7rem 0.8rem;
    }

    /* Filter Bar Adjustments */
    .filter-bar {
        gap: 1rem;
        padding: 0.5rem;
    }

    .filter-item {
        min-width: 100%;
        /* Stack filters on mobile */
    }

    .filter-item.flex-2 {
        flex: unset;
        width: 100%;
    }

    /* Settings Page Cards */
    .store-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .store-card-body {
        grid-template-columns: 1fr !important;
    }

    /* Auth Pages */
    .auth-page {
        overflow-y: auto;
    }

    .auth-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .auth-container.reverse {
        flex-direction: column;
    }

    .auth-brand-side {
        display: none;
    }

    .auth-form-side {
        padding: 1rem;
    }

    .auth-form-wrapper {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    /* Modals */
    .modal-container {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-item a {
        font-size: 0.66rem;
    }

    .nav-icon {
        font-size: 1.25rem;
    }
}

@keyframes quickLinksSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}