/* ═══════════════════════════════════════════
   COS – Company Operating System Styles
   ═══════════════════════════════════════════ */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --topbar-height: 56px;
    --primary: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f1f5f9; color: #1e293b; }

/* ── Sidebar ── */
.cos-wrapper { display: flex; min-height: 100vh; }
.cos-sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg); color: var(--sidebar-text);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    overflow-y: auto; transition: transform 0.3s;
}
.sidebar-header { padding: 1.25rem 1rem; border-bottom: 1px solid #334155; }
.sidebar-header h4 { color: #fff; margin: 0; font-size: 1.25rem; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1rem; color: var(--sidebar-text); text-decoration: none;
    font-size: 0.9rem; transition: all 0.15s;
}
.sidebar-nav li a:hover { background: #334155; color: #fff; }
.sidebar-nav li.active a { background: var(--sidebar-active); color: #fff; border-left: 3px solid #fff; }
.sidebar-nav li.sidebar-section {
    padding: 1rem 1rem 0.3rem; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; color: #64748b;
}

/* ── Main content area ── */
.cos-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.cos-topbar {
    background: #fff; height: var(--topbar-height); display: flex; align-items: center;
    padding: 0 1.5rem; border-bottom: 1px solid #e2e8f0;
}
.cos-main { padding: 1.5rem; flex: 1; }

/* ── Topbar login partial ── */
.cos-topbar .navbar-nav { flex-direction: row; gap: 0.5rem; align-items: center; }
.cos-topbar .nav-link { font-size: 0.875rem; padding: 0.25rem 0.5rem; }

/* ── Stat cards ── */
.stat-card {
    background: #fff; border-radius: 0.75rem; padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid var(--primary);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #1e293b; }
.stat-card .stat-label { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card.green  { border-left-color: var(--success); }
.stat-card.yellow { border-left-color: var(--warning); }
.stat-card.red    { border-left-color: var(--danger); }
.stat-card.blue   { border-left-color: var(--primary); }

/* ── Page header ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h2 { margin: 0; font-weight: 700; }

/* ── Cards / Tables ── */
.cos-card { background: #fff; border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.cos-card .card-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 0.75rem 1rem; font-weight: 600; }
.cos-card .card-body { padding: 1rem; }
.table th { font-size: 0.8rem; text-transform: uppercase; color: #64748b; font-weight: 600; letter-spacing: 0.03em; }
.table td { vertical-align: middle; }

/* ── Badges ── */
.badge-status { padding: 0.3em 0.7em; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fef3c7; color: #92400e; }
.badge-done     { background: #dbeafe; color: #1e40af; }
.badge-overdue  { background: #fee2e2; color: #991b1b; }
.badge-todo     { background: #f1f5f9; color: #475569; }
.badge-inprogress { background: #e0f2fe; color: #0369a1; }
.badge-inreview { background: #fef3c7; color: #92400e; }

/* ── Guest layout ── */
.cos-guest-wrapper { min-height: 100vh; background: #f1f5f9; }

/* ── Login page ── */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 100px); padding: 2rem 1rem;
}
.login-card {
    background: #fff; border-radius: 1rem; padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(30, 41, 59, 0.12); width: 100%; max-width: 420px;
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo {
    width: 64px; height: 64px; border-radius: 1rem; background: var(--sidebar-bg);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 0.75rem;
}
.login-logo i { font-size: 1.75rem; color: #fff; }
.login-brand h1 { font-size: 1.5rem; font-weight: 800; color: var(--sidebar-bg); margin: 0; letter-spacing: 0.05em; }
.login-brand p { color: #64748b; font-size: 0.85rem; margin: 0.25rem 0 0; }
.login-card .form-floating { position: relative; }
.login-card .form-floating > .form-control {
    border-radius: 0.625rem; border: 1.5px solid #e2e8f0; padding: 1rem 0.75rem 0.5rem;
    font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card .form-floating > .form-control:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.login-card .form-floating > label { color: #94a3b8; font-size: 0.875rem; }
.btn-login {
    background: var(--sidebar-bg); color: #fff; border: none; padding: 0.75rem;
    border-radius: 0.625rem; font-weight: 600; font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
}
.btn-login:hover { background: #334155; color: #fff; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.login-footer { text-align: center; color: #94a3b8; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f1f5f9; }

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .cos-sidebar { transform: translateX(-100%); }
    .cos-sidebar.show { transform: translateX(0); }
    .cos-content { margin-left: 0; }
}

/* ── Form tweaks ── */
.form-group { margin-bottom: 1rem; }
.form-label { font-weight: 600; font-size: 0.875rem; color: #475569; }

/* ── Quick actions ── */
.quick-action { text-align: center; padding: 1.5rem; border-radius: 0.75rem; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: transform 0.15s, box-shadow 0.15s; }
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.quick-action i { font-size: 2rem; color: var(--primary); }
.quick-action a { text-decoration: none; color: inherit; display: block; }