/* ============================================================
   Sunztech Office Portal — single color theme (indigo)
   Change --brand-* variables below to re-theme the whole site.
   ============================================================ */

:root {
    --brand-900: #1e1b4b;
    --brand-800: #312e81;
    --brand-700: #3730a3;
    --brand-600: #4f46e5;
    --brand-500: #6366f1;
    --brand-400: #818cf8;
    --brand-300: #a5b4fc;
    --brand-200: #c7d2fe;
    --brand-100: #e0e7ff;
    --brand-50:  #eef2ff;

    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f4f5fb;
    --white: #ffffff;
    --border: #e5e7eb;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(30, 27, 75, .08), 0 4px 16px rgba(30, 27, 75, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App layout ---------- */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--brand-900);
    color: var(--brand-100);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: .3px;
    border-bottom: 1px solid var(--brand-800);
}

.sidebar .brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--brand-600);
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #fff;
}

.sidebar nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--brand-200);
    font-weight: 500;
}

.sidebar nav a:hover { background: var(--brand-800); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--brand-600); color: #fff; }

.sidebar .sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--brand-800);
    font-size: 13px;
    color: var(--brand-300);
}

.main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar .page-title { font-size: 17px; font-weight: 600; }

.topbar .user-box { display: flex; align-items: center; gap: 12px; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}

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

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-img,
.profile-avatar-placeholder {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-placeholder {
    background: var(--brand-100);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 32px;
}

.employee-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.table-avatar-placeholder {
    background: var(--brand-100);
    color: var(--brand-700);
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

.user-meta { line-height: 1.2; text-align: right; }
.user-meta .name { font-weight: 600; font-size: 14px; }
.user-meta .role { font-size: 12px; color: var(--text-muted); }

.content { padding: 28px; }

/* ---------- Impersonation banner ---------- */

.impersonation-banner {
    background: var(--brand-600);
    color: #fff;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.impersonation-banner form { margin: 0; }

/* ---------- Cards / stats ---------- */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card + .card { margin-top: 20px; }

.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border-left: 4px solid var(--brand-600);
}

.stat .label { color: var(--text-muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 30px; font-weight: 700; color: var(--brand-800); margin-top: 4px; }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--brand-600);
    color: #fff;
    transition: background .15s;
}

.btn:hover { background: var(--brand-700); text-decoration: none; }

.btn-outline {
    background: transparent;
    color: var(--brand-600);
    border-color: var(--brand-300);
}

.btn-outline:hover { background: var(--brand-50); color: var(--brand-700); }

.btn-light {
    background: #fff;
    color: var(--brand-700);
}

.btn-light:hover { background: var(--brand-50); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #991b1b; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    background: var(--brand-50);
    color: var(--brand-800);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

tbody tr:hover { background: #fafaff; }

.actions { display: flex; gap: 8px; }
.actions form { margin: 0; }

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

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active { background: var(--brand-100); color: var(--brand-700); }
.badge-inactive { background: #f3f4f6; color: var(--text-muted); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-late { background: var(--brand-200); color: var(--brand-900); }

.badge-running {
    background: var(--brand-600);
    color: #fff;
}

.badge-running::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    margin-right: 5px;
    vertical-align: 1px;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

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

label { font-size: 13px; font-weight: 600; color: var(--brand-800); }

input, select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}

.field-error { color: var(--danger); font-size: 13px; }

.form-footer { margin-top: 22px; display: flex; gap: 10px; }

/* ---------- Alerts ---------- */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background: var(--brand-100); color: var(--brand-800); border: 1px solid var(--brand-200); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

/* ---------- Charts ---------- */

.charts-row {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.chart-card svg.bar-chart { width: 100%; height: auto; display: block; }

.bar-chart .tick {
    font-size: 11px;
    fill: var(--text-muted);
    font-family: inherit;
}

.legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 7px; }

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none;
}

.donut-card { display: flex; flex-direction: column; }

.donut-wrap {
    position: relative;
    width: 180px;
    margin: 4px auto 10px;
}

.donut-wrap svg { width: 100%; height: auto; display: block; }

.donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
}

.donut-center .rate { font-size: 30px; font-weight: 700; color: var(--brand-900); line-height: 1.1; }
.donut-center .cap { font-size: 12px; color: var(--text-muted); }

.donut-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.donut-stats > div { display: flex; align-items: center; gap: 8px; }
.donut-stats strong { margin-left: auto; color: var(--text); }

.chart-tooltip {
    position: fixed;
    z-index: 200;
    background: var(--brand-900);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(30, 27, 75, .3);
}

.chart-tooltip strong { color: var(--brand-200); }

/* ---------- Check-in box ---------- */

.checkin-box { display: flex; flex-direction: column; gap: 14px; }

.checkin-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.checkin-time .label { color: var(--text-muted); font-weight: 500; }
.checkin-time strong { font-size: 18px; color: var(--brand-900); }

/* ---------- Calendar ---------- */

.calendar-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .calendar-layout { grid-template-columns: 1fr; }
}

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

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.calendar-head .dow {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--brand-800);
    padding: 6px 0;
}

.cal-cell {
    min-height: 92px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.cal-cell.outside { opacity: .38; }
.cal-cell.off { background: #eef0f6; }
.cal-cell.holiday { background: var(--brand-50); border-color: var(--brand-200); }

.cal-cell.today {
    border: 2px solid var(--brand-600);
    box-shadow: 0 0 0 3px var(--brand-100);
}

.cal-daynum { font-size: 13px; font-weight: 700; color: var(--brand-900); }
.cal-cell.today .cal-daynum { color: var(--brand-600); }

.chip {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-announcement { background: var(--brand-600); color: #fff; }
.chip-holiday { background: var(--brand-200); color: var(--brand-900); }
.chip-off { background: transparent; color: var(--text-muted); font-weight: 500; padding-left: 0; }

/* ---------- Feed (sidebar lists) ---------- */

.feed { display: flex; flex-direction: column; gap: 12px; }

.feed-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.feed-item:last-child { border-bottom: none; padding-bottom: 0; }

.feed-date {
    flex: none;
    background: var(--brand-100);
    color: var(--brand-800);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.feed-body { flex: 1; font-size: 14px; min-width: 0; }
.feed-body strong { color: var(--brand-900); }
.feed-body p { color: var(--text-muted); font-size: 13px; margin-top: 2px; overflow-wrap: break-word; }

.stack-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.stack-form .form-group { width: 100%; }

textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    resize: vertical;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}

/* ---------- Month meter ---------- */

.month-meter { margin-bottom: 18px; }

.meter-numbers {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

.meter-numbers .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

.meter-numbers .big { font-size: 24px; font-weight: 700; color: var(--brand-800); }
.meter-numbers .big.muted { color: var(--text-muted); font-weight: 600; }

.meter-track {
    height: 12px;
    border-radius: 999px;
    background: var(--brand-100);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--brand-600);
    transition: width .3s;
}

.meter-caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.month-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.month-facts > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.month-facts .label { color: var(--text-muted); }

/* ---------- Pagination ---------- */

.pagination-wrap { margin-top: 18px; display: flex; justify-content: flex-end; }
.pagination-wrap nav { font-size: 14px; }

/* ---------- Page head ---------- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-head h1 { font-size: 20px; color: var(--brand-900); }

.search-form { display: flex; gap: 8px; }
.search-form input { min-width: 220px; }

/* ---------- Login page ---------- */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--brand-900);
    position: relative;
    overflow: hidden;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(400px, calc(100vw - 32px));
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 36px 32px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.login-card .login-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--brand-600);
    display: grid;
    place-items: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; color: var(--brand-300); font-size: 14px; margin-bottom: 26px; }

.login-card label { color: var(--brand-200); }

.login-card input {
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
}

.login-card input::placeholder { color: var(--brand-300); }

.login-card input:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, .25);
}

.login-card .form-group { margin-bottom: 16px; }

.login-card .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--brand-200);
}

.login-card .remember input { width: auto; }

.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

.login-card .field-error { color: #fca5a5; }

/* ---------- Face attendance ---------- */

.face-video {
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    background: #111;
    display: block;
    transform: scaleX(-1);
}

.face-status {
    color: var(--text-muted);
    font-size: 14px;
    margin: 10px 0;
    min-height: 20px;
}

.face-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.face-modal-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.face-modal-card .face-video { margin: 0 auto; }

/* ---------- Announcement types ---------- */

.badge-general { background: var(--brand-100); color: var(--brand-700); }

.badge-warning { background: #fef3c7; color: #92400e; }

.badge-urgent {
    background: #fee2e2;
    color: #b91c1c;
    animation: urgentPulse 1.4s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.chip-urgent { background: #dc2626 !important; }
.chip-warning { background: #d97706 !important; }

/* ---------- Announcements page ---------- */

.ann-banner {
    position: relative;
    height: 170px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1b4b, #312e81 60%, #4338ca);
    margin-bottom: 20px;
}

.ann-banner canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ann-banner-text {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 28px;
    color: #fff;
}

.ann-banner-text h1 { margin: 0 0 4px; font-size: 26px; }

.ann-banner-text p { margin: 0; color: var(--brand-200); font-size: 14px; }

.ann-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ann-card {
    opacity: 0;
    animation: annIn 0.5s ease forwards;
    border-left: 4px solid var(--brand-600);
}

.ann-card.ann-urgent { border-left-color: #dc2626; }
.ann-card.ann-warning { border-left-color: #d97706; }

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

.ann-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ann-date { color: var(--text-muted); font-size: 13px; }

.ann-title { margin: 0 0 6px; font-size: 18px; }

.ann-body {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.7;
    white-space: pre-line;
}

/* ---------- Announcement popup ---------- */

.ann-popup-overlay {
    display: flex;
    animation: annIn 0.3s ease;
}

.ann-popup-card {
    text-align: left;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
}

.ann-popup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ann-popup-item {
    border: 1px solid #eef0f6;
    border-left: 4px solid var(--brand-600);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafaff;
}

.ann-popup-item.ann-urgent { border-left-color: #dc2626; background: #fef2f2; }
.ann-popup-item.ann-warning { border-left-color: #d97706; background: #fffbeb; }

.ann-popup-item p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13.5px;
    white-space: pre-line;
}

/* ---------- Calendar day box ---------- */

.cal-cell[data-date] { cursor: pointer; }

.cal-cell.selected {
    outline: 2px solid var(--brand-600);
    outline-offset: -2px;
    border-radius: 8px;
}

.day-box { border-top: 3px solid var(--brand-600); }

.day-box-hint { color: var(--text-muted); font-size: 13.5px; margin: 0; }

.day-box-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    background: #fafaff;
    border: 1px solid #eef0f6;
    animation: annIn 0.3s ease;
}

.day-box-item p { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; white-space: pre-line; }

.day-box-holiday { background: var(--brand-100); border-color: var(--brand-200); }

.day-box-funny {
    margin: 0;
    padding: 14px;
    text-align: center;
    font-size: 14.5px;
    color: var(--brand-700);
    background: var(--brand-50, #eef2ff);
    border-radius: 10px;
    animation: annIn 0.3s ease;
}

/* ---------- Settings / profile page ---------- */

.settings-header {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    border-top: 3px solid var(--brand-600);
}

.settings-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.settings-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 0 3px var(--brand-100);
}

.settings-avatar-placeholder {
    background: var(--brand-100);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 38px;
}

.avatar-edit {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-600);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background 0.15s;
}

.avatar-edit:hover { background: var(--brand-700); }

.settings-id { min-width: 220px; }

.settings-id h2 { margin: 0 0 2px; font-size: 22px; }

.settings-role {
    color: var(--brand-600);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.settings-contact {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 14px;
}

.avatar-remove { margin-top: 8px; }

.avatar-remove button {
    background: none;
    border: none;
    padding: 0;
    color: var(--danger, #dc2626);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.settings-meta {
    margin-left: auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.settings-joined { color: var(--text-muted); font-size: 13px; }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

.card-sub {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: -4px 0 16px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .settings-header { flex-direction: column; text-align: center; }
    .settings-contact { justify-content: center; }
    .settings-meta { margin: 0 auto; align-items: center; text-align: center; }
}

/* ---------- Password show/hide ---------- */

.password-wrap {
    position: relative;
}

.password-wrap input {
    width: 100%;
    padding-right: 42px;
}

.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    padding: 4px 6px;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.pw-toggle:hover,
.pw-toggle.pw-visible {
    opacity: 1;
}

/* ---------- Work reports ---------- */

.work-report-box {
    background: var(--brand-50, #eef2ff);
    border: 1px solid var(--brand-100, #e0e7ff);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
    max-width: 640px;
}

.work-report-box p {
    margin: 0;
    font-size: 14px;
    white-space: pre-line;
}

.report-details summary {
    cursor: pointer;
    color: var(--brand-600);
    font-weight: 600;
    font-size: 13px;
}

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

.task-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    background: #fafaff;
    border: 1px solid #eef0f6;
    border-radius: 8px;
    padding: 8px 12px;
}

.task-item p { margin: 0; font-size: 14px; white-space: pre-line; }

.task-time {
    color: var(--brand-600);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.task-form textarea { width: 100%; }

.report-entry {
    padding: 4px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.report-entry:last-child { border-bottom: none; }

.report-text {
    white-space: pre-line;
    font-size: 13px;
    color: var(--text, #111827);
    background: #fafaff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    margin-top: 6px;
    max-width: 340px;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--brand-300);
}

.auth-switch a {
    color: var(--brand-100);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.login-footer {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    text-align: center;
    color: var(--brand-300);
    font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .content { padding: 18px; }
    .topbar { padding: 12px 18px; }
    .mobile-nav {
        display: flex !important;
        gap: 6px;
        overflow-x: auto;
        background: var(--brand-900);
        padding: 10px 14px;
    }
    .mobile-nav a {
        color: var(--brand-200);
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    .mobile-nav a.active { background: var(--brand-600); color: #fff; }
}

.mobile-nav { display: none; }
