* { box-sizing: border-box; }

:root {
    --blue: #0073ea;
    --blue-dark: #0060b9;
    --blue-soft: #eaf4ff;
    --text: #323338;
    --muted: #676879;
    --line: #d0d4e4;
    --line-soft: #e6e9ef;
    --sidebar: #f7f8fa;
    --surface: #ffffff;
    --green: #00c875;
    --orange: #fdab3d;
    --red: #e2445c;
    --shadow: 0 4px 14px rgba(32, 37, 50, .08);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--surface);
}

html, body { min-height: 100%; }
body { margin: 0; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

/* Application shell */
.app-shell { display: flex; min-height: 100vh; background: #fff; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; }
.brand-mark, .login-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(145deg, #0073ea, #5b5bd6);
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(0, 115, 234, .25);
}
.brand-name { font-size: 16px; font-weight: 700; line-height: 1.15; }
.brand-subtitle { color: var(--muted); font-size: 11px; margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 5px 10px 18px; }
.nav-section-label { color: #77798a; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 13px 10px 7px; }
.nav-project-label { margin-top: 8px; }
.nav-item { min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0; border-radius: 6px; color: #4c4d55; transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: #eceef2; color: var(--text); }
.nav-item.active { background: #cce5ff; color: #1f4b75; }
.nav-icon { width: 18px; text-align: center; color: #636575; font-size: 16px; }
.sidebar-client { padding: 9px 10px 3px 14px; color: #868797; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-nav-item { padding-left: 15px; }
.project-dot { width: 9px; height: 9px; border-radius: 3px; background: #579bfc; flex: 0 0 auto; }
.sidebar-user { display: flex; align-items: center; gap: 9px; min-height: 66px; padding: 10px 13px; border-top: 1px solid var(--line); background: white; }
.user-avatar, .topbar-avatar, .member-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 700; }
.user-avatar { width: 35px; height: 35px; color: white; background: #323338; flex: 0 0 auto; }
.user-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.user-copy span { color: var(--muted); font-size: 11px; }
.logout-button { border: 0; background: transparent; color: #77798a; font-size: 17px; padding: 6px; border-radius: 5px; }
.logout-button:hover { background: #f0f1f4; }

.app-main { margin-left: 264px; width: calc(100% - 264px); min-height: 100vh; }
.app-topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: white; position: sticky; top: 0; z-index: 10; }
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.topbar-chip { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; }
.topbar-avatar { width: 31px; height: 31px; background: #111827; color: white; }
.page-content { padding: 24px 38px 60px; overflow-x: hidden; }

/* Page heading and tabs */
.page-heading, .project-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 13px; }
.page-heading h1, .project-heading h1 { margin: 2px 0 4px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.page-heading p, .project-heading p { margin: 4px 0 0; color: var(--muted); max-width: 680px; }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.project-title-line { display: flex; align-items: center; gap: 7px; }
.title-caret { color: #6b6d7a; font-size: 18px; }
.project-tabs { height: 42px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.project-tab { height: 42px; display: flex; align-items: center; padding: 0 10px; border-bottom: 2px solid transparent; color: #555662; }
.project-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.project-tab.coming-soon { opacity: .55; }

/* Toolbars */
.board-toolbar { display: flex; align-items: center; gap: 5px; min-height: 48px; margin-bottom: 14px; }
.dashboard-toolbar { border-bottom: 1px solid var(--line-soft); }
.primary-button { height: 34px; padding: 0 13px; border: 0; border-radius: 5px; background: var(--blue); color: white; font-weight: 600; }
.primary-button:hover { background: var(--blue-dark); }
.button-caret { margin-left: 10px; padding-left: 9px; border-left: 1px solid rgba(255,255,255,.3); }
.toolbar-button { height: 34px; padding: 0 10px; border: 0; border-radius: 5px; color: #4f5058; background: transparent; }
.toolbar-button:hover:not(:disabled) { background: #f1f2f5; }
.toolbar-button:disabled { opacity: 1; }
.toolbar-button span { margin-right: 4px; color: #676879; }
.toolbar-primary { color: var(--blue); font-weight: 600; padding: 0 9px 0 0; }

/* Monday-like task board */
.board-group { margin: 0 0 30px; --group-color: #579bfc; }
.group-completed { --group-color: #00c875; }
.group-title-row { display: flex; align-items: center; min-height: 34px; color: var(--group-color); padding-left: 10px; }
.group-title-row h2 { margin: 0; font-size: 19px; font-weight: 600; }
.group-chevron { margin-right: 7px; font-size: 18px; }
.group-count { color: #8a8b98; font-size: 11px; margin-left: 10px; }
.board-table-wrap { border-left: 6px solid var(--group-color); border-radius: 6px 0 0 6px; overflow-x: auto; box-shadow: var(--shadow); }
.board-table { width: 100%; min-width: 850px; border-collapse: collapse; table-layout: fixed; background: white; }
.board-table th, .board-table td { height: 40px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 11px; vertical-align: middle; }
.board-table thead th { height: 38px; color: #45464d; background: white; font-weight: 500; text-align: center; border-top: 1px solid var(--line); }
.board-table tbody tr:hover td { background-color: #f5f9ff; }
.board-table tbody tr:hover .status-cell { background: white; }
.board-table .check-col { width: 34px; padding: 0; text-align: center; }
.board-table .task-col { width: 28%; }
.board-table .owner-col { width: 130px; }
.board-table .status-col { width: 168px; }
.board-table .priority-col { width: 115px; }
.board-table .date-col { width: 125px; }
.board-table .add-col { width: 42px; padding: 0; font-size: 20px; color: #77798a; }
.fake-check { width: 16px; height: 16px; display: inline-block; border: 1px solid #b8bdca; border-radius: 2px; background: white; }
.task-name-cell { position: relative; text-align: left; }
.task-name { display: inline-block; max-width: calc(100% - 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-bubble { float: right; color: #6b6d78; font-size: 17px; }
.owner-cell { text-align: center; }
.avatar-stack { display: flex; align-items: center; justify-content: center; }
.member-avatar { width: 29px; height: 29px; margin-left: -5px; border: 2px solid white; background: #323338; color: white; font-size: 12px; }
.member-avatar:first-child { margin-left: 0; }
.empty-avatar { background: white; color: #b8bdca; border: 1px solid #c9ccd6; font-size: 20px; font-weight: 400; }
.status-cell { padding: 0 !important; text-align: center; }
.status-block { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: center; color: white; font-weight: 600; background: var(--status-color, #676879); padding: 0 8px; }
.status-empty { background: #c4c4c4; }
.priority-pill { display: inline-flex; min-width: 72px; justify-content: center; padding: 4px 8px; border-radius: 12px; font-size: 11px; background: #eceef2; color: #555662; }
.priority-high { background: #ffe1e6; color: #b4233c; }
.priority-urgent { background: #ffd2da; color: #a81732; font-weight: 700; }
.priority-low { background: #e7f8f1; color: #167a55; }
.date-cell { text-align: center; color: #676879; }
.muted-dash { color: #b5b7c2; }
.add-task-row td { background: #fff !important; height: 37px; }
.add-task-row button { border: 0; background: transparent; color: #696b75; padding: 7px 4px; }
.add-task-row button:disabled { color: #696b75; }
.dashboard-table .task-name-cell { width: 29%; }
.dashboard-table .status-col { width: 165px; }
.empty-row td { height: 100px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); }
.empty-state strong { color: var(--text); }

/* Project list */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; margin-top: 24px; }
.client-card { border: 1px solid var(--line); border-radius: 9px; background: white; overflow: hidden; box-shadow: 0 2px 8px rgba(31, 35, 48, .05); }
.client-card-header { min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.client-initial { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: #eaf4ff; color: var(--blue); font-size: 19px; font-weight: 700; }
.card-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.client-card h2 { margin: 2px 0 0; font-size: 17px; }
.project-card-list { padding: 7px; }
.project-card-row { display: flex; align-items: center; min-height: 43px; padding: 5px 10px; border-radius: 6px; }
.project-card-row:hover { background: #f2f7fd; }
.project-color-bar { width: 5px; height: 26px; border-radius: 3px; background: #579bfc; margin-right: 10px; }
.project-card-name { flex: 1; font-weight: 500; }
.project-card-arrow { color: #9698a5; font-size: 22px; }
.empty-panel { border: 1px dashed var(--line); border-radius: 9px; padding: 38px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-panel strong { color: var(--text); }

/* Login */
.auth-body { min-height: 100vh; background: linear-gradient(145deg, #f4f8fd 0%, #ffffff 50%, #eef5ff 100%); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: 100%; max-width: 430px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-size: 20px; font-weight: 700; }
.login-card { border: 1px solid #e0e3ea; border-radius: 12px; background: white; box-shadow: 0 16px 50px rgba(25, 34, 55, .12); padding: 34px; }
.login-card h1 { margin: 0 0 6px; font-size: 27px; }
.login-card > p { margin: 0 0 25px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; }
.login-form label { font-size: 12px; font-weight: 600; margin: 0 0 6px; }
.login-form input { height: 42px; border: 1px solid #b9bdc9; border-radius: 6px; padding: 0 11px; margin: 0 0 17px; outline: none; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,115,234,.12); }
.login-button { height: 42px; border: 0; border-radius: 6px; background: var(--blue); color: white; font-weight: 700; margin-top: 2px; }
.login-button:hover { background: var(--blue-dark); }
.form-error { margin-bottom: 15px; padding: 10px; border-radius: 6px; background: #fff0f2; color: #b4233c; font-size: 12px; }
.form-error ul { margin: 0; padding-left: 18px; }

@media (max-width: 900px) {
    .sidebar { width: 210px; }
    .app-main { margin-left: 210px; width: calc(100% - 210px); }
    .page-content { padding: 22px 20px 50px; }
}

@media (max-width: 680px) {
    .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar-nav { max-height: 230px; }
    .sidebar-user { display: none; }
    .app-shell { display: block; }
    .app-main { margin-left: 0; width: 100%; }
    .app-topbar { height: 54px; padding: 0 16px; }
    .page-content { padding: 18px 12px 40px; }
    .client-grid { grid-template-columns: 1fr; }
    .page-heading h1, .project-heading h1 { font-size: 24px; }
}
