/* Devotech HQ additions on top of portal.css (shared with the Sales portal). */

/* ---- Page width ----
   portal.css caps the content at 1200px (fine for the Sales portal's forms). HQ pages use the whole window,
   so the timesheet grid, tables and cards grow and shrink with it. */
.content { max-width: none; }

/* ---- Sidebar: section labels, counts, coming-soon items ---- */
.nav-section {
    margin: 18px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(214, 218, 227, .55);
}

.nav-count {
    display: inline-block;
    min-width: 20px;
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f59e0b;
    color: #1d2130;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.nav .nav-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    color: rgba(214, 218, 227, .40);
    cursor: default;
    font-size: 13px;
}

.nav .nav-disabled svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.sidebar-footer a { display: block; margin-bottom: 4px; }

/* ---- Generic helpers ---- */
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.spacer { flex: 1; }
.sub { color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
label.block { display: block; margin: 12px 0 8px; }
label.block textarea { display: block; width: 100%; max-width: 640px; margin-top: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
label.inline { display: inline-flex; align-items: center; gap: 6px; }
tr.inactive td { opacity: .55; }
tr.selected-row td { background: rgba(91, 95, 245, .07); }

/* ---- Dashboard: number cards ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 4px solid var(--stat-color, var(--brand));
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
}

a.stat:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(29, 33, 48, .08); }

.stat-value { font-size: 24px; font-weight: 600; margin: 6px 0; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--muted); }

.meter { height: 6px; background: #eceef4; border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--stat-color, var(--brand)); border-radius: 999px; }

/* ---- Dashboard: module tiles ---- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.tile {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
    background: #fafbfd;
}

a.tile:hover { text-decoration: none; border-color: var(--brand); background: #fff; }
.tile-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.tile-text { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tile-disabled { opacity: .6; }

/* ---- Timesheet status labels ---- */
.ts-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ts-none { background: #eceef4; color: var(--muted); }
.ts-draft { background: #e8eafd; color: #4347d9; }
.ts-submitted { background: #fff3cd; color: #8a6100; }
.ts-approved { background: var(--success-bg); color: var(--success-text); }
.ts-rejected { background: #fde7e7; color: var(--danger); }

/* ---- My timesheet: week navigation and grid ---- */
.week-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.week-label { margin: 0 8px; font-size: 16px; }

.ts-grid { width: 100%; border-collapse: collapse; }
/* On narrow screens the grid keeps a usable width and scrolls sideways inside its card. */
.ts-grid { min-width: 980px; }
.ts-grid th, .ts-grid td { padding: 6px 6px; vertical-align: middle; }
.ts-grid select, .ts-grid input[type=text] { width: 100%; min-width: 0; margin: 0; }
.ts-grid .ts-what { min-width: 140px; width: 14%; }
.ts-grid .ts-notes { min-width: 140px; width: 18%; }
.ts-grid .ts-day { text-align: center; min-width: 64px; }
.ts-grid th.ts-day small { font-weight: 400; color: var(--muted); }
.ts-grid .weekend { background: #f7f8fb; }
.ts-grid th.today { color: var(--brand); }
.ts-grid input.ts-hours { width: 100%; min-width: 52px; margin: 0; text-align: right; padding: 6px; }
.ts-grid tfoot th { border-top: 2px solid var(--border); }
.ts-grid.readonly td { white-space: nowrap; }

.ts-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 6px;
}

/* ---- Reports ---- */
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.report-filters label { margin: 0; }
.quick-ranges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.share-col { width: 25%; min-width: 120px; }

/* ---- Setup ---- */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form input[type=text], .inline-form select { margin: 0; max-width: 320px; }

/* portal.css pushes buttons right (margin-left:auto); inside these rows they should sit in order. */
.week-bar button, .ts-actions button, .inline-form button, .tabs button, td button, label.block + button { margin-left: 0; }
.week-bar button:disabled { opacity: .5; }

/* ---- Activity ---- */
.tracked-note { font-size: 11px; color: rgba(214, 218, 227, .7) !important; }
.signin-notice { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.5; }

table.activity-table tr.clickable { cursor: pointer; }
table.activity-table tr.clickable:hover td { background: #f7f8fb; }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 #e53935; }
.flag {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fde7e7;
    color: var(--danger);
    font-size: 12px;
    white-space: nowrap;
}
.flag-list { margin: 0 0 12px; padding-left: 18px; color: var(--danger); }
.flag-list li { border: none; padding: 2px 0; }
.meter.meter-warn span { background: #e53935; }

.activity-day h3 { margin-top: 22px; }
.timeline {
    position: relative;
    height: 34px;
    margin-top: 8px;
    background: repeating-linear-gradient(90deg, #f3f5f9 0, #f3f5f9 calc(12.5% - 1px), #e5e8ef calc(12.5% - 1px), #e5e8ef 12.5%);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.timeline-block { position: absolute; top: 6px; bottom: 6px; min-width: 2px; border-radius: 2px; }
.timeline-block.active { background: #2e7d32; }
.timeline-block.idle { background: #cbd2dd; }
.timeline-action { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f59e0b; }
.timeline-scale { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.timeline-scale span { position: absolute; transform: translateX(-50%); }
.timeline-scale span:first-child { transform: none; }
.timeline-scale span:last-child { transform: translateX(-100%); }
.timeline-key { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.timeline-key .key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-left: 10px; }
.timeline-key .key.active { background: #2e7d32; }
.timeline-key .key.idle { background: #cbd2dd; }
.timeline-key .key.action { background: #f59e0b; width: 3px; }

/* Sign in with Microsoft */
.microsoft-signin button { width: 100%; padding: 10px; margin-left: 0; }
.signin-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.signin-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-size: 12px; color: var(--muted); }
.signin-divider::before, .signin-divider::after { content: ""; flex: 1; border-top: 1px solid #e3e5ee; }

/* Edit / delete buttons at the end of setup rows */
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions button { margin-left: 4px; padding: 6px 12px; }
td.row-actions button.link { padding: 6px 4px; color: var(--brand); }
td.row-actions span { margin-right: 6px; }
