/* =========================================================
   Office Task Manager - Premium SaaS UI
   Full replacement stylesheet. CSS-only presentation layer.
   Design direction: Linear / Notion / Stripe dashboard.
   ========================================================= */

:root {
    --sidebar-width: 224px;

    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-hover: #f1f5f9;

    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --muted-light: #94a3b8;

    --border: #e5e7eb;
    --border-soft: #eef2f7;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;

    --success: #22c55e;
    --success-text: #15803d;
    --success-soft: #dcfce7;
    --warning: #f59e0b;
    --warning-text: #92400e;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-text: #b91c1c;
    --danger-soft: #fee2e2;
    --info: #0ea5e9;
    --info-text: #0369a1;
    --info-soft: #e0f2fe;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .035);
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, .045);
    --focus: 0 0 0 3px rgba(79, 70, 229, .13);
}

[data-theme="dark"] {
    --bg: #020617;
    --surface: #0f172a;
    --surface-subtle: #111827;
    --surface-hover: #172033;
    --text: #e5e7eb;
    --text-soft: #cbd5e1;
    --muted: #94a3b8;
    --muted-light: #64748b;
    --border: #1f2937;
    --border-soft: #172033;
    --primary-soft: rgba(79, 70, 229, .18);
    --success-soft: rgba(34, 197, 94, .16);
    --warning-soft: rgba(245, 158, 11, .16);
    --danger-soft: rgba(239, 68, 68, .16);
    --info-soft: rgba(14, 165, 233, .16);
    --shadow-xs: none;
    --shadow-sm: none;
}

* { box-sizing: border-box; letter-spacing: 0; }

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body,
body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img, svg { max-width: 100%; }

/* Layout */
.app-shell {
    display: block;
    min-height: 100vh;
}

.app-content {
    width: 100%;
    min-width: 0;
}

.app-sidebar {
    display: none !important;
}

.content-wrap {
    width: 100%;
    max-width: 100%;
    padding: 12px 12px 84px !important;
}

.app-footer {
    padding: 0 12px 88px !important;
    color: var(--muted);
    font-size: .78rem;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px !important;
    height: 52px !important;
    padding: 0 12px !important;
    background: rgba(246, 248, 251, .92) !important;
    border-bottom: 1px solid var(--border) !important;
    backdrop-filter: blur(16px);
}

[data-theme="dark"] .topbar {
    background: rgba(2, 6, 23, .92) !important;
}

.topbar-title {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-title .small {
    display: block;
    color: var(--muted) !important;
    font-size: .72rem;
    line-height: 1.1;
}

.topbar-title .fw-semibold {
    display: block;
    max-width: 180px;
    overflow: hidden;
    color: var(--text);
    font-size: .92rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-search {
    display: none !important;
}

.topbar-search input {
    width: 100%;
    min-height: 30px;
    padding: 0 !important;
    color: var(--text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.icon-btn {
    display: inline-grid !important;
    place-items: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    color: var(--muted) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    transition: background .14s ease, color .14s ease;
}

.icon-btn:hover {
    color: var(--text) !important;
    background: var(--surface-hover) !important;
}

.profile-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 32px !important;
    padding: 0 !important;
    color: var(--text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.profile-chip:hover { color: var(--primary) !important; }

.profile-chip-text {
    display: none;
    line-height: 1.05;
    text-align: left;
}

.profile-chip-text strong {
    color: var(--text);
    font-size: .82rem;
    font-weight: 750;
}

.profile-chip-text small {
    color: var(--muted) !important;
    font-size: .66rem;
    font-weight: 750;
    text-transform: uppercase;
}

/* Avatars */
.user-avatar,
.user-avatar-sm,
.user-avatar-xs,
.mini-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    font-weight: 800;
}

.user-avatar { width: 32px; height: 32px; font-size: .82rem; }
.user-avatar-sm { width: 28px; height: 28px; font-size: .74rem; }
.user-avatar-xs { width: 22px; height: 22px; font-size: .64rem; }
.mini-avatar {
    width: 28px;
    height: 28px;
    color: var(--primary);
    background: var(--primary-soft);
}

.avatar-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 1050;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    min-height: 56px;
    padding: 6px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .11);
    backdrop-filter: blur(16px);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(15, 23, 42, .96);
}

.mobile-bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    min-width: 48px;
    padding: 6px 7px;
    color: var(--muted);
    border-radius: 8px;
    font-size: .66rem;
    font-weight: 750;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Sidebar */
.brand-mark {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 5px 7px 12px;
    color: var(--text) !important;
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.1;
}

.brand-icon,
.brand-logo {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    margin-top: 8px;
    padding-right: 2px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.sidebar-group-label {
    margin: 14px 9px 5px;
    color: var(--muted-light) !important;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 9px !important;
    color: var(--muted) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px;
    box-shadow: none !important;
    font-size: .86rem;
    font-weight: 650;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.sidebar-link i {
    width: 17px;
    min-width: 17px;
    color: currentColor;
    opacity: .82;
}

.sidebar-link:hover {
    color: var(--text) !important;
    background: var(--surface-hover) !important;
}

.sidebar-link.active {
    color: var(--primary) !important;
    background: var(--primary-soft) !important;
    border-color: rgba(79, 70, 229, .12) !important;
}

.nav-count {
    margin-left: auto;
    min-width: 18px;
    padding: 2px 5px;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    font-size: .68rem;
    line-height: 1;
    text-align: center;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 10px 5px 0;
    border-top: 1px solid var(--border) !important;
}

/* Typography */
.page-title,
h1.page-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.16rem, 4vw, 1.52rem) !important;
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -.028em;
}

.page-kicker,
.text-secondary,
.text-muted {
    color: var(--muted) !important;
}

small,
.small { font-size: .76rem; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    letter-spacing: -.02em;
}

/* Cards and panels */
.card,
.dashboard-hero,
.detail-hero,
.stat-card,
.table-card,
.chart-card,
.soft-card,
.profile-card,
.form-panel .card,
.login-card,
.list-group-item {
    color: var(--text) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-xs) !important;
}

.dashboard-hero,
.detail-hero {
    padding: 14px !important;
}

.card,
.soft-card,
.profile-card,
.form-panel .card,
.login-card {
    padding: 12px !important;
}

.stat-card {
    min-height: 92px;
    padding: 12px !important;
    overflow: hidden;
}

.stat-card:hover,
.table-card:hover,
.profile-card:hover {
    box-shadow: var(--shadow-sm) !important;
}

.section-head,
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px !important;
    padding: 9px 12px !important;
    color: var(--text) !important;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: .9rem;
    font-weight: 800;
}

.card-footer {
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
}

.stat-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 8px;
}

.kpi-foot {
    margin-top: 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 650;
}

/* Charts */
.chart-card { overflow: hidden; }
.chart-wrap {
    height: 230px;
    padding: 10px 12px 12px;
}
.chart-wrap-wide { height: 260px; }

/* Buttons */
.btn,
button.btn,
a.btn,
input[type="submit"].btn,
input[type="button"].btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 32px !important;
    height: 32px;
    padding: 0 11px !important;
    color: var(--text-soft) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    font-size: .84rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.btn i,
.btn svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.btn:hover {
    color: var(--primary) !important;
    background: var(--primary-soft) !important;
    border-color: rgba(79, 70, 229, .24) !important;
}

.btn-primary {
    color: #fff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover {
    color: #fff !important;
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    background: transparent !important;
    border-color: rgba(79, 70, 229, .3) !important;
}

.btn-outline-secondary,
.btn-secondary {
    color: var(--text-soft) !important;
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

.btn-sm {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 8px !important;
    font-size: .76rem !important;
    border-radius: 6px !important;
}

.btn-lg {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 14px !important;
}

.action-dot {
    width: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

/* Forms */
.form-label {
    margin-bottom: 5px;
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 700;
}

.form-control,
.form-select,
input,
select,
textarea {
    min-height: 34px;
    color: var(--text) !important;
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    font-size: .86rem;
}

.form-control,
.form-select {
    padding: 6px 9px !important;
}

textarea.form-control,
textarea {
    min-height: 78px;
    height: auto;
    resize: vertical;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(79, 70, 229, .58) !important;
    box-shadow: var(--focus) !important;
    outline: none !important;
}

.form-control::placeholder,
textarea::placeholder { color: var(--muted-light); }

.form-text { color: var(--muted) !important; font-size: .74rem; }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--surface-subtle);
    width: 100%;
    margin: 0;
    color: var(--text);
    border-collapse: collapse;
    font-size: .86rem;
}

.table thead th {
    padding: 8px 10px !important;
    color: var(--muted) !important;
    background: var(--surface-subtle) !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: 8px 10px !important;
    color: var(--text-soft);
    border-top: 1px solid var(--border-soft) !important;
    vertical-align: middle;
}

.table-hover tbody tr:hover,
.table tbody tr:hover {
    background: var(--surface-subtle) !important;
}

@media (max-width: 767.98px) {
    .table { min-width: 680px; }
}

/* Badges and alerts */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: .32rem .52rem;
    border: 1px solid transparent;
    border-radius: 999px !important;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1;
}

.text-bg-primary,
.text-bg-info {
    color: var(--primary) !important;
    background: var(--primary-soft) !important;
    border-color: rgba(79, 70, 229, .13) !important;
}

.text-bg-success {
    color: var(--success-text) !important;
    background: var(--success-soft) !important;
    border-color: rgba(34, 197, 94, .16) !important;
}

.text-bg-warning {
    color: var(--warning-text) !important;
    background: var(--warning-soft) !important;
    border-color: rgba(245, 158, 11, .18) !important;
}

.text-bg-danger {
    color: var(--danger-text) !important;
    background: var(--danger-soft) !important;
    border-color: rgba(239, 68, 68, .18) !important;
}

.text-bg-secondary {
    color: var(--muted) !important;
    background: var(--surface-hover) !important;
    border-color: var(--border) !important;
}

.alert {
    border-radius: var(--radius) !important;
    border-color: var(--border) !important;
}

/* Tabs */
.nav-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-subtle);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 9px;
    color: var(--muted);
    background: transparent !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-tabs .nav-link.active {
    color: var(--text) !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-xs);
}

/* Mobile cards */
.task-mobile-card,
.todo-card-row {
    margin: 8px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    transition: border-color .14s ease, background .14s ease;
}

.task-mobile-card:hover,
.todo-card-row:hover {
    background: var(--surface-subtle) !important;
    border-color: rgba(79, 70, 229, .22) !important;
}

.task-mobile-card.overdue,
.risk-alert.overdue { border-left: 3px solid var(--danger) !important; }
.task-mobile-card.risky,
.risk-alert.risky { border-left: 3px solid var(--warning) !important; }

/* Chat */
.chat-panel { overflow: hidden; }

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
}

.chat-head-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.chat-head-title i {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #fff;
    background: var(--primary);
    border-radius: 7px;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 220px;
    max-height: 58vh;
    padding: 12px;
    overflow-y: auto;
    background: var(--surface-subtle);
}

.chat-message {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.chat-avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: #334155;
    border-radius: 8px;
    font-size: .68rem;
    font-weight: 800;
}

.chat-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 8px 10px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px 10px 10px 10px;
}

.chat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .7rem;
}

.chat-author { color: var(--text); font-weight: 800; }
.chat-text { color: var(--text-soft); line-height: 1.45; white-space: normal; }

.chat-composer {
    position: sticky;
    bottom: 0;
    padding: 10px;
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
}

.chat-composer textarea {
    min-height: 68px;
    background: var(--surface-subtle) !important;
    border-radius: var(--radius) !important;
}

.chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

/* Utility components */
.empty-state {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 112px;
    margin: 0;
    padding: 16px;
    color: var(--muted);
    background: var(--surface-subtle);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    text-align: center;
}

.empty-state i {
    color: var(--muted-light);
    font-size: 1.35rem;
}

.todo-note {
    padding: 7px 9px;
    color: var(--text-soft);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: normal;
}

.progress {
    height: .48rem;
    background: var(--surface-hover);
    border-radius: 999px;
}

.progress-bar {
    background: var(--primary);
    border-radius: 999px;
}

.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.dropdown-menu {
    color: var(--text);
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
}

.dropdown-item {
    color: var(--text-soft);
    font-size: .86rem;
}

.dropdown-item:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.offcanvas {
    color: var(--text) !important;
    background: var(--surface) !important;
}

/* Login / Auth - premium SaaS entry */
.auth-wrap {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 16%, rgba(79, 70, 229, .14), transparent 24rem),
        radial-gradient(circle at 82% 10%, rgba(14, 165, 233, .10), transparent 22rem),
        linear-gradient(135deg, #f6f8fb 0%, #eef2ff 100%);
}

[data-theme="dark"] .auth-wrap {
    background:
        radial-gradient(circle at 18% 16%, rgba(79, 70, 229, .22), transparent 24rem),
        radial-gradient(circle at 82% 10%, rgba(14, 165, 233, .12), transparent 22rem),
        #020617;
}

.login-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .11) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, .52), transparent 72%);
}

.login-orb {
    position: absolute;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    filter: blur(54px);
    opacity: .42;
    pointer-events: none;
    transform: translateZ(0);
    animation: loginFloat 10s ease-in-out infinite alternate;
}

.login-orb-one {
    top: -5rem;
    left: -4rem;
    background: rgba(79, 70, 229, .25);
}

.login-orb-two {
    right: -5rem;
    bottom: 8rem;
    background: rgba(14, 165, 233, .18);
    animation-delay: -4s;
}

@keyframes loginFloat {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(14px, -10px, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .login-orb { animation: none; }
}

.login-column {
    max-width: 420px;
}

.login-card {
    overflow: hidden;
    width: 100%;
    background: rgba(255, 255, 255, .92) !important;
    border: 1px solid rgba(229, 231, 235, .92) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(18px);
}

[data-theme="dark"] .login-card {
    background: rgba(15, 23, 42, .88) !important;
    border-color: rgba(31, 41, 55, .95) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .26) !important;
}

.login-card-body {
    padding: 22px !important;
}

.login-brand {
    justify-content: center;
    gap: 9px;
    padding: 0;
    border: 0;
    color: var(--text) !important;
    font-size: .92rem;
}

.login-card h1 {
    color: var(--text);
    font-size: 1.22rem !important;
    font-weight: 800 !important;
    letter-spacing: -.025em;
}

.login-card p {
    color: var(--muted) !important;
    font-size: .88rem;
}

.login-card .form-label {
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 750;
}

.login-card .form-control {
    min-height: 38px;
    padding: 8px 10px !important;
    background: var(--surface) !important;
    border-color: var(--border) !important;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-card .form-control:focus {
    border-color: rgba(79, 70, 229, .62) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .13) !important;
}

.login-card .input-group .btn {
    min-height: 38px !important;
    height: 38px !important;
}

.login-card .btn-primary {
    min-height: 38px !important;
    height: 38px !important;
    font-weight: 800 !important;
    transition: background .18s ease, transform .18s ease;
}

.login-card .btn-primary:hover {
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .login-card-body {
        padding: 20px !important;
    }

    .login-column {
        max-width: 100%;
    }
}

/* Weekly planner */
.weekly-plan-table td { vertical-align: top; }
.weekly-plan-table tbody tr.table-primary td { background: var(--primary-soft) !important; }
.weekly-mobile-section {
    display: grid;
    gap: 3px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    white-space: normal;
}

.weekly-mobile-section span {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.weekly-plan-row.current-day,
.task-mobile-card.current-day {
    border-left: 3px solid var(--primary) !important;
    background: var(--primary-soft) !important;
}

/* Desktop */
@media (min-width: 768px) {
    .profile-chip-text { display: grid; }

    .topbar-search {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex: 0 1 400px;
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 10px !important;
        color: var(--muted);
        background: var(--surface) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius-md) !important;
        box-shadow: none !important;
    }

    .content-wrap {
        padding: 14px 16px 28px !important;
    }
}

@media (min-width: 992px) {
    .app-shell { display: flex; }

    .app-sidebar {
        position: sticky;
        top: 0;
        display: flex !important;
        flex-direction: column;
        width: var(--sidebar-width);
        height: 100vh;
        padding: 12px 10px;
        color: var(--text) !important;
        background: var(--surface) !important;
        border-right: 1px solid var(--border) !important;
        box-shadow: none !important;
        overflow: hidden;
    }

    .app-content {
        width: calc(100% - var(--sidebar-width));
        min-width: 0;
    }

    .topbar {
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 16px !important;
    }

    .content-wrap {
        max-width: 1280px;
        margin: 0 auto;
        padding: 14px 16px 28px !important;
    }

    .app-footer {
        padding: 0 16px 16px !important;
    }

    .mobile-bottom-nav { display: none !important; }

    .dashboard-hero,
    .detail-hero { padding: 16px !important; }

    .card,
    .soft-card,
    .profile-card,
    .form-panel .card,
    .login-card { padding: 12px !important; }
}

@media (min-width: 1400px) {
    .content-wrap { max-width: 1360px; }
}

/* Dark mode component fixes */
[data-theme="dark"] .card,
[data-theme="dark"] .dashboard-hero,
[data-theme="dark"] .detail-hero,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .soft-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .form-panel .card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .section-head,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .chat-head,
[data-theme="dark"] .chat-composer,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    color: var(--text) !important;
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .table thead th,
[data-theme="dark"] .chat-list,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .todo-note {
    background: var(--surface-subtle) !important;
}

[data-theme="dark"] .table tbody td,
[data-theme="dark"] .chat-text,
[data-theme="dark"] .chat-bubble {
    color: var(--text-soft) !important;
}
