/* =========================================
   X3D Print Tracker - Layout
   Sidebar, Topbar, Main, Pages, Responsive
   ========================================= */

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: #fff;
    /* d-flex flex-column position-fixed vh-100 via Bootstrap */
    top: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 16.5px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-nav {
    /* flex-grow-1 d-flex flex-column via Bootstrap */
    padding: 16px 12px;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item .premium-icon {
    position: absolute;
    right: 8px;
    color: #ffd54f;
    font-size: 0.7rem;
    opacity: 0.8;
}

.nav-feedback {
    margin-top: auto;
}

/* Premium badge when placed after the menu text (align to right) */
.nav-item > .nav-premium-badge {
    margin-left: auto;
    color: #ffd54f;
    font-size: 0.85rem;
    opacity: 0.95;
}

.nav-icon-badge {
    position: relative;
    display: inline-flex;
    width: 20px;
    justify-content: center;
}

/* small overlay variant used inside icon badges */
.nav-icon-badge .nav-premium-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    font-size: 0.45rem !important;
    color: #ffd54f;
    width: auto !important;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* =========================================
   Main Content
   ========================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* d-flex flex-column min-vh-100 via Bootstrap */
    transition: var(--transition);
    min-width: 0;
    width: auto;
}

/* =========================================
   Top Bar
   ========================================= */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    /* d-flex align-items-center sticky-top via Bootstrap */
    padding: 0 32px;
    z-index: 50;
    gap: 16px;
    width: calc(100vw - var(--sidebar-width));
    flex: 0 0 var(--topbar-height);
    box-sizing: border-box;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.topbar-actions {
    /* d-flex align-items-center via Bootstrap */
    gap: 12px;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.lang-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.lang-btn:hover {
    background: var(--border);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* =========================================
   Topbar Icon Buttons & Notification Bell
   ========================================= */
.topbar-icon-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.topbar-icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    pointer-events: none;
}

/* Contextual topbar button */
#topbarContextActions .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}
.topbar-btn-label {
    margin-left: 4px;
}

/* =========================================
   Notification Dropdown Panel
   ========================================= */
.notif-panel {
    position: absolute;
    top: calc(var(--topbar-height) - 4px);
    right: 24px;
    width: 380px;
    max-height: 460px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.2));
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideIn .2s ease;
}
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.notif-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.notif-panel-header .btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.notif-panel-header .btn-text:hover {
    background: rgba(99,102,241,.1);
}

.notif-panel-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}

/* Single notification item */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: var(--bg);
}
.notif-item.unread {
    background: rgba(99,102,241,.04);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--primary);
}
.notif-item.unread .notif-item-icon {
    background: rgba(99,102,241,.12);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}
.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: .7;
}

/* Delete button */
.notif-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
    align-self: center;
}
.notif-item:hover .notif-delete-btn {
    opacity: 0.6;
}
.notif-delete-btn:hover {
    opacity: 1 !important;
    color: var(--danger, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

/* Unread dot */
.notif-dot {
    position: absolute;
    top: 16px;
    right: 38px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* Empty state */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    opacity: .6;
    gap: 8px;
}
.notif-empty i {
    font-size: 1.8rem;
}
.notif-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* =========================================
   Buttons (base + standard variants now in styles-overrides.css)
   Custom-only button classes remain below
   ========================================= */

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* =========================================
   Pages
   ========================================= */
.page {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.page.active {
    display: block;
}

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

}
/* =========================================
   X3D Print Tracker - Styles
   ========================================= */

:root {
    --primary: #00a862;
    --primary-dark: #008a50;
    --primary-light: #e0f5ec;
    --secondary: #1a1a2e;
    --accent: #0f3460;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Previously undeclared � now explicit */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-subtle: #f8f9fa;
    --bg-hover: rgba(0, 168, 98, 0.08);
    --border-light: #f0f1f3;
    --warning-light: rgba(255, 152, 0, 0.1);
    --warning-dark: #b45309;
}

* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    /* PWA safe area support for iPhone notch/dynamic island */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* =========================================
   Scrollbar
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: #fff;
    /* d-flex flex-column position-fixed vh-100 via Bootstrap */
    top: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-nav {
    /* flex-grow-1 d-flex flex-column via Bootstrap */
    padding: 16px 12px;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item .premium-icon {
    position: relative;
    padding-bottom: inherit;
    right: 8px;
    color: #ffd54f;
    font-size: 0.7rem;
    opacity: 0.8;
}

.nav-feedback {
    margin-top: auto;
}

/* Premium badge when placed after the menu text (align to right) */
.nav-item > .nav-premium-badge {
    margin-left: auto;
    color: #ffd54f;
    font-size: 0.85rem;
    opacity: 0.95;
}

.nav-icon-badge {
    position: relative;
    display: inline-flex;
    width: 20px;
    justify-content: center;
}

/* small overlay variant used inside icon badges */
.nav-icon-badge .nav-premium-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    font-size: 0.45rem !important;
    color: #ffd54f;
    width: auto !important;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* =========================================
   Main Content
   ========================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* d-flex flex-column min-vh-100 via Bootstrap */
    transition: var(--transition);
    min-width: 0;
    width: auto;
}

/* =========================================
   Top Bar
   ========================================= */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    /* d-flex align-items-center sticky-top via Bootstrap */
    padding: 0 32px;
    z-index: 50;
    gap: 16px;
    width: calc(100vw - var(--sidebar-width));
    flex: 0 0 var(--topbar-height);
    box-sizing: border-box;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.topbar-actions {
    /* d-flex align-items-center via Bootstrap */
    gap: 12px;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.lang-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.lang-btn:hover {
    background: var(--border);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* =========================================
   Topbar Icon Buttons & Notification Bell
   ========================================= */
.topbar-icon-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.topbar-icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    pointer-events: none;
}

/* Contextual topbar button */
#topbarContextActions .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}
.topbar-btn-label {
    margin-left: 4px;
}

/* =========================================
   Notification Dropdown Panel
   ========================================= */
.notif-panel {
    position: absolute;
    top: calc(var(--topbar-height) - 4px);
    right: 24px;
    width: 380px;
    max-height: 460px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.2));
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideIn .2s ease;
}
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.notif-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.notif-panel-header .btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.notif-panel-header .btn-text:hover {
    background: rgba(99,102,241,.1);
}

.notif-panel-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}

/* Single notification item */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: var(--bg);
}
.notif-item.unread {
    background: rgba(99,102,241,.04);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--primary);
}
.notif-item.unread .notif-item-icon {
    background: rgba(99,102,241,.12);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}
.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: .7;
}

/* Delete button */
.notif-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
    align-self: center;
}
.notif-item:hover .notif-delete-btn {
    opacity: 0.6;
}
.notif-delete-btn:hover {
    opacity: 1 !important;
    color: var(--danger, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

/* Unread dot */
.notif-dot {
    position: absolute;
    top: 16px;
    right: 38px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* Empty state */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    opacity: .6;
    gap: 8px;
}
.notif-empty i {
    font-size: 1.8rem;
}
.notif-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* =========================================
   Buttons (base + standard variants now in styles-overrides.css)
   Custom-only button classes remain below
   ========================================= */

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* =========================================
   Pages
   ========================================= */
.page {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.page.active {
    display: block;
}

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

/* =========================================
   Stats Grid
   ========================================= */
.stats-grid {
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-sub-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
}

/* =========================================
   Cards
   ========================================= */
.x3d-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 35px;
}

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

.x3d-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.x3d-card-header h3 i {
    color: var(--primary);
}

.x3d-card-body {
    padding: 24px;
}

/* =========================================
   Empty State
   ========================================= */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* =========================================
   Upload Area
   ========================================= */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    background: var(--bg);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* OCR Loading Overlay */
.ocr-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ocr-loading-content {
    text-align: center;
    color: #fff;
}

.ocr-loading-content p {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 16px;
}

.ocr-loading-content small {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

.ocr-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-preview {
    position: relative;
    width: 100%;
}

.upload-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* =========================================
   OCR Banner
   ========================================= */
.ocr-banner {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.ocr-banner i {
    font-size: 1.2rem;
}

/* =========================================
   Form Styles
   ========================================= */
.print-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label,
.form-group .label-spacer {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: var(--primary);
    font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text);
}

.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
    background: var(--card-bg);
}

.color-input-group input[type="text"] {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.form-card {
    max-width: 850px;
    margin: 0 auto;
}

/* =========================================
   Form Section Titles
   ========================================= */
.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    padding: 8px 0 4px;
    border-bottom: 2px solid var(--primary-light);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

.calculated-field {
    background: var(--bg) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* =========================================
   Cost Summary Box
   ========================================= */
.cost-summary {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 8px;
}

.cost-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.cost-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.cost-item i {
    font-size: 1.3rem;
    color: var(--primary);
    margin-top: 2px;
}

.cost-item.cost-total {
    background: var(--primary-light);
    border-color: var(--primary);
}

.cost-item.cost-total i {
    color: var(--primary-dark);
}

.cost-detail {
    display: flex;
    flex-direction: column;
}

.cost-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cost-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.cost-sub {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* =========================================
   Cost badge on cards
   ========================================= */
.cost-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 12px;
}

@media (max-width: 767.98px) {
    .cost-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Prints Grid (List View)
   ========================================= */
.prints-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.list-header-row {
    display: grid;
    grid-template-columns: 40px 60px 2fr 100px 90px 70px 70px 60px 80px 90px;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
}

.list-row {
    display: grid;
    grid-template-columns: 40px 60px 2fr 100px 90px 70px 70px 60px 80px 90px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: var(--transition);
}

.list-row:hover {
    background: var(--bg-hover);
}

.list-row:last-child {
    border-bottom: none;
}

.list-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.list-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg);
    flex-shrink: 0;
}

.list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-image .no-image {
    color: var(--text-light);
    font-size: 1.5rem;
}

.list-image .source-badge-cloud {
    top: 2px;
    right: 2px;
    padding: 1px 4px;
    font-size: 0.6em;
}

.list-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    min-width: 0;
}

.print-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-printer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-status {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.list-status .status-badge {
    font-size: 0.7rem;
    padding: 3px 7px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-date,
.list-filament,
.list-time,
.list-weight,
.list-cost {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-shrink: 0;
}

.list-actions .btn-sm {
    padding: 4px 8px;
    font-size: 0.78rem;
    min-width: unset;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle button {
    padding: 8px 12px;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.view-toggle button:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.view-toggle button.active {
    background: var(--primary);
    color: white;
}

.view-toggle button.active:hover {
    background: var(--primary-dark);
}

/* Bulk actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--warning-dark);
}

@media (max-width: 991.98px) {
    .list-header-row,
    .list-row {
        grid-template-columns: 36px 46px 2fr 85px 80px 60px 60px 55px 70px 75px;
        gap: 6px;
        padding: 10px 12px;
        font-size: 0.78rem;
    }
    
    .list-image {
        width: 46px;
        height: 46px;
    }

    .list-actions .btn-sm {
        padding: 3px 6px;
        font-size: 0.72rem;
    }
}

@media (max-width: 767.98px) {
    .prints-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .list-header-row,
    .list-row {
        min-width: 800px;
        grid-template-columns: 32px 42px 2fr 80px 75px 55px 55px 50px 65px 70px;
        padding: 8px 10px;
    }

    .list-image {
        width: 42px;
        height: 42px;
    }
    
    .list-actions {
        flex-direction: column;
        gap: 2px;
    }
}

.print-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.print-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.print-card-image {
    height: 180px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.print-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.print-card-image .no-image {
    color: var(--text-light);
    font-size: 3rem;
}

.print-card-body {
    padding: 16px;
}

.print-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.print-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.print-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.print-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   Status Badge
   ========================================= */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.queued {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.printing {
    background: #fff3e0;
    color: #e65100;
    animation: pulse-badge 2s infinite;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.failed {
    background: #ffebee;
    color: #c62828;
}

.status-badge.cancelled {
    background: #f5f5f5;
    color: #616161;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =========================================
   Status Bars (Dashboard Chart)
   ========================================= */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* =========================================
   List Header / Filters
   ========================================= */
.list-header {
    flex-wrap: wrap;
    gap: 12px;
}

.list-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.85rem;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    width: 220px;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--card-bg);
    cursor: pointer;
}

/* =========================================
   Modal
   ========================================= */
.x3d-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.x3d-modal-overlay.active {
    display: flex;
}

.x3d-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

/* @keyframes modalIn � single definition below (search: MFA modals section) */

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

.x3d-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.x3d-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: var(--transition);
}

.x3d-modal-close:hover {
    color: var(--danger);
}

.x3d-modal-body {
    padding: 24px;
}

.x3d-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* =========================================
   Print Detail in Modal
   ========================================= */
.detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    background: var(--bg);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item span {
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-notes {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =========================================
   Filament Cards
   ========================================= */

.filament-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.filament-card:hover {
    box-shadow: var(--shadow-md);
}

.filament-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filament-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.filament-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.filament-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.filament-bar-track {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.filament-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.filament-usage {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* =========================================
   Recent Print Row
   ========================================= */
.recent-print-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

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

.recent-print-item:hover {
    background: var(--bg);
    margin: 0 -24px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
}

.recent-print-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-print-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-print-thumb i {
    color: var(--text-light);
}

.recent-print-info {
    flex: 1;
    min-width: 0;
}

.recent-print-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-print-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Toast Notifications � moved to single block below (search: x3d-toast) */

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 991.98px) {
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        padding: 0 12px;
        width: 100vw;
    }

    .page-title {
        font-size: 1rem;
    }

    .page {
        padding: 16px 12px;
    }



    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-filters {
        width: 100%;
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }


    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Notification panel full-width on mobile */
    .notif-panel {
        right: 0;
        left: 0;
        width: 100vw;
        max-height: 70vh;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    /* Hide topbar context btn label on mobile */
    .topbar-btn-label {
        display: none;
    }

    /* Sidebar overlay backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 99;
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* Card headers responsive */
    .x3d-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .x3d-card-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Subscription grid */
    .subscription-actions {
        flex-direction: column;
    }
    .subscription-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Settings form */
    .form-group {
        margin-bottom: 16px;
    }

    /* Modal responsive */
    .x3d-modal {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
        max-height: 90vh;
    }

    /* Transaction table scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Topbar actions tighter gap */
    .topbar-actions {
        gap: 8px;
    }
    .lang-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
}

@media (max-width: 575.98px) {

    /* Even tighter spacing */
    .page {
        padding: 12px 8px;
    }
    .topbar {
        padding: 0 8px;
        gap: 8px;
    }

    /* Touch-friendly inputs */
    input, select, textarea, .form-control {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 44px;
    }
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .nav-item {
        min-height: 44px;
    }

    /* Login card responsive */
    .login-card {
        padding: 28px 20px;
    }
}

/* =========================================
   Login Page
   ========================================= */
.login-page {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.login-page.hidden {
    display: none;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    text-align: center;
    animation: loginFadeIn 0.5s ease;
}

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

.login-logo {
    margin-bottom: 36px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0, 168, 98, 0.3);
}

.login-logo-icon i {
    font-size: 2rem;
    color: #fff;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.btn-oauth {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border: none;
}

.btn-oauth:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-google {
    background: #fff;
    color: #3c4043;
    border: 1.5px solid #dadce0 !important;
}

.btn-google:hover:not(:disabled) {
    background: #f7f8f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #c0c3c7 !important;
}

.btn-google:active:not(:disabled) {
    background: #eef0f1;
}

.btn-apple {
    background: #000;
    color: #fff;
}

.btn-apple:hover:not(:disabled) {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-apple:active:not(:disabled) {
    background: #333;
}

/* Coming Soon badge overlay */
.coming-soon-badge {
    position: absolute;
    top: -8px;
    right: -6px;
    background: var(--warning, #ff9800);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    z-index: 1;
    pointer-events: none;
}

.btn-microsoft {
    background: #fff;
    color: #5e5e5e;
    border: 1.5px solid #dadce0 !important;
}

.btn-microsoft:hover:not(:disabled) {
    background: #f3f3f3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #c0c3c7 !important;
}

.btn-microsoft:active:not(:disabled) {
    background: #e8e8e8;
}

.login-error {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
    border-radius: 8px;
    font-size: 0.875rem;
    border: 1px solid rgba(244, 67, 54, 0.25);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-offline {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px dashed var(--border);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.2s ease;
}

.btn-offline:hover {
    background: var(--bg);
    border-color: var(--text-light);
    color: var(--text);
}

.login-footer-text {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 20px;
    line-height: 1.6;
}

/* ---- App container visibility ---- */
.app-container {
    /* d-flex via Bootstrap */
}

/* ---- Sidebar user section ---- */
.sidebar-user-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user-section .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-section .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-section .user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-section .user-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-section .plan-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 2px;
}

.sidebar-user-section .plan-badge.free {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}

.sidebar-user-section .plan-badge.premium {
    background: #ffd700;
    color: #333;
}

.sidebar-user-section .btn-logout {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-user-section .btn-logout:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* ---- Premium lock ---- */
.premium-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.premium-locked::after {
    content: '?';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
}

/* ---- Premium crown ---- */
.premium-crown {
    color: #ffd700;
    font-size: 0.9rem;
    margin-left: 4px;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 991.98px) {
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        padding: 0 12px;
        width: 100vw;
    }

    .page-title {
        font-size: 1rem;
    }

    .page {
        padding: 16px 12px;
    }



    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-filters {
        width: 100%;
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }


    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Notification panel full-width on mobile */
    .notif-panel {
        right: 0;
        left: 0;
        width: 100vw;
        max-height: 70vh;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    /* Hide topbar context btn label on mobile */
    .topbar-btn-label {
        display: none;
    }

    /* Sidebar overlay backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 99;
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* Card headers responsive */
    .x3d-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .x3d-card-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Subscription grid */
    .subscription-actions {
        flex-direction: column;
    }
    .subscription-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Settings form */
    .form-group {
        margin-bottom: 16px;
    }

    /* Modal responsive */
    .x3d-modal {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
        max-height: 90vh;
    }

    /* Transaction table scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Topbar actions tighter gap */
    .topbar-actions {
        gap: 8px;
    }
    .lang-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
}

@media (max-width: 575.98px) {

    /* Even tighter spacing */
    .page {
        padding: 12px 8px;
    }
    .topbar {
        padding: 0 8px;
        gap: 8px;
    }

    /* Touch-friendly inputs */
    input, select, textarea, .form-control {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 44px;
    }
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .nav-item {
        min-height: 44px;
    }

    /* Login card responsive */
    .login-card {
        padding: 28px 20px;
    }
}
/* =========================================
   Notification message expand/collapse
   ========================================= */
.notif-item-msg.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.notif-expand-toggle {
    font-size: 0.72rem;
    color: var(--primary);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin-top: 2px;
    font-weight: 500;
    display: inline-block;
}
.notif-expand-toggle:hover {
    text-decoration: underline;
}

/* =========================================
   iPhone 15 / Small Mobile (≤430px)
   ========================================= */
@media (max-width: 430px) {

    /* Topbar: tighter spacing, smaller icon buttons */
    .topbar {
        padding: 0 6px;
        gap: 6px;
    }
    .topbar-actions {
        gap: 4px;
    }
    .topbar-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .page-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    .lang-btn {
        padding: 3px 8px;
        font-size: 0.68rem;
    }
    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    /* Page content tighter padding */
    .page {
        padding: 10px 6px;
    }

    /* Notification panel full-width */
    .notif-panel {
        width: 100vw;
        right: -6px;
        max-height: 70vh;
    }

    /* Modal even tighter */
    .x3d-modal {
        width: 96vw;
        max-width: 96vw;
        margin: 8px auto;
        padding: 16px 12px;
    }
    .x3d-modal h3 {
        font-size: 1.05rem;
    }

    /* Card headers stack */
    .x3d-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    .x3d-card-header .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
    }
    .x3d-card-body {
        padding: 12px;
    }
}
