/* Blaser Consulting Project Manager
   Brand: #008FFF (primary), #030101 (dark), #003F78 (deep navy)
   Font:  Inter
*/

:root {
    --brand:        #008FFF;
    --brand-deep:   #003F78;
    --brand-dark:   #030101;
    --brand-tint:   #e6f4ff;
    --brand-soft:   #f5fbff;

    --bg:           #f6f7f9;
    --surface:      #ffffff;
    --border:       #e5e8ed;
    --border-soft:  #eef0f4;
    --text:         #0f1722;
    --muted:        #6b7280;
    --muted-soft:   #9aa3af;

    --success:      #15803d;
    --success-bg:   #dcfce7;
    --warning:      #b45309;
    --warning-bg:   #fef3c7;
    --danger:       #b91c1c;
    --danger-bg:    #fee2e2;

    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 1px 2px rgba(15,23,34,.04), 0 4px 14px rgba(15,23,34,.04);
    --shadow-lg:    0 10px 30px rgba(3,1,1,.10);

    --sidebar-w:    248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
a.link { color: var(--brand); font-weight: 500; }
a.link:hover { color: var(--brand-deep); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- Layout ---------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.brand-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}
.brand-mark {
    background: var(--brand);
    color: #fff;
    width: 38px; height: 38px;
    border-radius: 8px;
    display: grid; place-items: center;
    font-weight: 700;
    letter-spacing: .5px;
    font-size: 14px;
}
.brand-mark-lg { width: 52px; height: 52px; font-size: 18px; }
.brand-text strong {
    display: block;
    font-size: 16px;
    color: #fff;
    line-height: 1.1;
	padding-top:7px;
}
.brand-text span {
    display: block;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
    color: rgba(255,255,255,.72);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, color .15s;
}
.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
    text-decoration: none;
}
.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    color: var(--brand);
    font-size: 14px;
	color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 16px;
    margin-top: 16px;
}
.user-chip {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.avatar {
    background: var(--brand);
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 600;
    font-size: 13px;
}
.avatar.small { width: 24px; height: 24px; font-size: 11px; }
.user-meta { line-height: 1.2; }
.user-name { color: #fff; font-weight: 500; font-size: 13.5px; }
.user-role { color: rgba(255,255,255,.5); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.logout-form { margin: 0; }

.main {
    padding: 24px 36px 60px;
    min-width: 0;
}
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: var(--brand-dark);
}

.content { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Auth ---------- */

.auth-body {
    background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-dark) 100%);
    min-height: 100vh;
}
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 36px;
    width: 100%;
    max-width: 420px;
}
.auth-title { margin: 18px 0 4px; font-size: 22px; color: var(--brand-dark); }
.auth-sub   { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.auth-footer {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    margin-top: 24px;
    text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn-text {
    color: var(--brand-deep);
    background: transparent;
}
.btn-text:hover { background: var(--brand-tint); color: var(--brand-deep); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(185,28,28,.3);
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-tiny  { padding: 2px 6px; font-size: 11.5px; color: var(--muted); }
.btn-tiny:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; }
.label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.field input[type=text], .field input[type=email],
.field input[type=password], .field input[type=date],
.field input[type=file], .field select, .field textarea, input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,143,255,.15);
}
textarea { resize: vertical; min-height: 80px; }
input[readonly], textarea[readonly] { background: var(--bg); color: var(--muted); }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }

.form-actions {
    display: flex; gap: 10px; align-items: center;
    margin-top: 4px;
}

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.check {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
    font-size: 13.5px;
}
.check:hover { border-color: var(--brand); background: var(--brand-soft); }
.check input { width: auto; }

.inline-form { display: inline; margin: 0; }

.value-display {
    padding: 9px 0;
}

/* ---------- Panels & Cards ---------- */

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    padding: 20px;
    box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 4px; font-size: 16px; color: var(--brand-dark); }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.panel-head h2, .panel-head h3 {
    margin: 0; font-size: 15px; color: var(--brand-dark); font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-2-3 {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .grid-2, .grid-2-3 { grid-template-columns: 1fr; }
}

/* ---------- Stats ---------- */

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.stat-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-dark);
}

/* ---------- Lists (dashboard) ---------- */

.proj-list, .task-list, .milestone-list { list-style: none; padding: 0; margin: 0; }
.proj-list li, .task-list li, .milestone-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    gap: 12px;
}
.proj-list li:last-child, .task-list li:last-child, .milestone-list li:last-child { border-bottom: none; }
.proj-link { display: flex; flex-direction: column; flex: 1; }
.proj-name { color: var(--text); font-weight: 500; }
.proj-meta { color: var(--muted); font-size: 12.5px; }
.task-title { color: var(--text); font-weight: 500; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ---------- Toolbar ---------- */

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.filter-tabs {
    display: flex; gap: 4px;
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}
.filter-tab {
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.filter-tab:hover { background: var(--brand-tint); color: var(--brand-deep); text-decoration: none; }
.filter-tab.is-active { background: var(--brand); color: #fff; }
.filter-tab.is-active:hover { background: var(--brand-deep); }

/* ---------- Project cards ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    color: var(--text);
    box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: var(--brand); text-decoration: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-title { margin: 4px 0 2px; font-size: 16px; color: var(--brand-dark); font-weight: 600; }
.card-desc { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.card-foot { margin-top: auto; padding-top: 6px; }

/* ---------- Project detail ---------- */

.proj-header { display: flex; flex-direction: column; gap: 14px; }
.proj-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.proj-header-top .actions { display: flex; gap: 8px; }
.proj-title { margin: 8px 0 4px; font-size: 22px; color: var(--brand-dark); }
.proj-desc { margin: 0; color: var(--text); }
.proj-stats {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 16px;
    padding: 14px 16px;
    background: var(--brand-soft);
    border-radius: var(--radius-sm);
}

/* ---------- Tabs ---------- */

.tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-top: 4px;
}
.tab {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--brand-deep); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.tab-panel { display: none; padding-top: 16px; }
.tab-panel.is-active { display: block; }

/* ---------- Adder (collapsible quick-add) ---------- */

.adder {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
}
.adder summary {
    cursor: pointer;
    color: var(--brand-deep);
    font-weight: 500;
    user-select: none;
    list-style: none;
}
.adder summary::-webkit-details-marker { display: none; }
.adder[open] {
    border-style: solid;
    background: var(--brand-soft);
}
.adder[open] summary { margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }

/* ---------- Task board (kanban) ---------- */

.task-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 1100px) { .task-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .task-board { grid-template-columns: 1fr; } }

.task-col {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 140px;
}
.task-col-head {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    padding: 4px 4px 10px;
}
.task-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}
.task-card-title { display: block; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.task-card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.task-card-status { margin-top: 6px; }
.task-card-status select {
    font-size: 12px;
    padding: 4px 6px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
}

/* ---------- Milestones ---------- */

.milestone-table { list-style: none; padding: 0; margin: 0; }
.milestone-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border-soft);
}
.milestone-row:last-child { border-bottom: none; }
.check-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}
.check-toggle.is-done { background: var(--brand); border-color: var(--brand); color: #fff; }
.milestone-title { color: var(--text); font-weight: 500; flex: 1; }
.milestone-title.is-done { color: var(--muted); text-decoration: line-through; }

/* ---------- Notes ---------- */

.note-list { display: flex; flex-direction: column; gap: 14px; }
.note-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
}
.note-head h4 { margin: 0 0 4px; color: var(--brand-dark); font-size: 15px; }
.note-body { color: var(--text); margin-top: 10px; white-space: pre-wrap; }

/* ---------- Files ---------- */

.file-uploader { background: var(--brand-soft); border: 1px dashed var(--brand); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; align-items: flex-end; flex-direction: row; gap: 16px; }
.file-uploader .field { flex: 1; }

.file-table, .data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.file-table th, .file-table td,
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}
.file-table thead th, .data-table thead th {
    background: var(--bg);
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.file-table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }

/* ---------- Comments ---------- */

.comments .comment-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 14px; }
.comment {
    background: var(--brand-soft);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.comment-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 13px;
}
.comment-body { color: var(--text); white-space: pre-wrap; font-size: 14px; }

.role-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}
.role-owner   { background: var(--brand-deep); color: #fff; }
.role-team    { background: var(--brand-tint); color: var(--brand-deep); }
.role-client  { background: #f0f0f0; color: #555; }

.comment-form { margin-top: 12px; }

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.badge-todo        { background: #f0f0f0; color: #555; }
.badge-in_progress { background: var(--brand-tint); color: var(--brand-deep); }
.badge-blocked     { background: var(--warning-bg); color: var(--warning); }
.badge-done        { background: var(--success-bg); color: var(--success); }
.badge-pending     { background: var(--brand-tint); color: var(--brand-deep); }
.badge-completed   { background: var(--success-bg); color: var(--success); }
.badge-active      { background: var(--success-bg); color: var(--success); }
.badge-on_hold     { background: var(--warning-bg); color: var(--warning); }
.badge-archived    { background: #f0f0f0; color: #555; }

/* ---------- Misc ---------- */

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error   { background: var(--danger-bg); color: var(--danger); }

.empty {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--muted);
}
.empty h2 { margin: 0 0 8px; color: var(--brand-dark); }

.progress {
    height: 6px;
    background: var(--border-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}
.progress-bar {
    height: 100%;
    background: var(--brand);
    transition: width .3s ease;
}

.danger-zone {
    margin-top: 24px;
    background: #fff;
    border: 1px solid var(--danger-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.danger-zone strong { color: var(--danger); }

.back-link {
    display: inline-block;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 13.5px;
}
.back-link:hover { color: var(--brand-deep); text-decoration: none; }


.brand-logo {
    display: block;
    max-height: 44px;
    max-width: 56px;;
    width: auto;
    height: auto;
}
.brand-logo-lg {
    max-height: 80px;
}