:root {
    --bg: #f3f6f9;
    --panel: #ffffff;
    --text: #111827;
    --muted: #667085;
    --line: #e5e9ef;
    --primary: #176b5b;
    --primary-dark: #0f5548;
    --primary-soft: #eaf6f2;
    --sidebar: #0f1f22;
    --sidebar-muted: #8da2a5;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --success: #087a5b;
    --shadow: 0 18px 50px rgba(16, 24, 40, .09);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
button, input { font: inherit; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--primary); color: white; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 7px 18px rgba(23,107,91,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }

.auth-body { min-height: 100vh; background: radial-gradient(circle at 15% 20%, rgba(23,107,91,.10), transparent 30%), #f7f9fb; }
.auth-shell { min-height: 100vh; width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 20px; display: flex; flex-direction: column; }
.auth-brand-wrap { margin-bottom: 24px; }
.auth-grid { flex: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 68px; align-items: center; padding: 20px 0 54px; }
.auth-hero { max-width: 590px; }
.eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .14em; font-size: 11px; }
.auth-hero h1, .register-intro h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.04; letter-spacing: -.052em; margin: 14px 0 22px; }
.auth-hero > p, .register-intro > p { color: var(--muted); font-size: 17px; line-height: 1.75; max-width: 560px; }
.hero-points { display: grid; gap: 12px; margin-top: 32px; }
.hero-points > div { display: grid; grid-template-columns: 40px 1fr; gap: 0 13px; align-items: center; padding: 11px 0; }
.hero-points span { grid-row: span 2; color: var(--primary); font-size: 12px; font-weight: 800; border: 1px solid #cfe1dc; background: white; border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; }
.hero-points strong { font-size: 14px; }
.hero-points small { color: var(--muted); margin-top: 3px; }

.auth-card, .register-card { background: rgba(255,255,255,.96); border: 1px solid rgba(221,226,232,.9); border-radius: 24px; box-shadow: var(--shadow); padding: 34px; }
.auth-card-wrap { width: 100%; max-width: 490px; justify-self: end; }
.card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.card-icon { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 20px; font-weight: 800; }
.card-heading h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.025em; }
.card-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: flex; justify-content: space-between; gap: 10px; color: #344054; font-weight: 650; font-size: 12px; margin-bottom: 7px; }
.field em { color: #98a2b3; font-style: normal; font-weight: 500; }
.field input { width: 100%; height: 48px; border: 1px solid #d7dde5; border-radius: 11px; padding: 0 14px; background: #fff; color: var(--text); outline: none; transition: .15s ease; }
.field input:focus { border-color: #82b5aa; box-shadow: 0 0 0 4px rgba(23,107,91,.08); }
.check-row { display: flex; gap: 9px; align-items: flex-start; color: #475467; font-size: 12px; line-height: 1.5; margin: 5px 0 18px; }
.check-row input { margin-top: 2px; accent-color: var(--primary); }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 0; border-radius: 11px; min-height: 46px; padding: 0 18px; text-decoration: none; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 8px 20px rgba(23,107,91,.16); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: #f7f8fa; color: #344054; border: 1px solid #e4e7ec; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 12px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.auth-switch a { color: var(--primary); font-weight: 700; text-decoration: none; }
.error-box { background: var(--danger-soft); color: var(--danger); border: 1px solid #ffd2cc; border-radius: 11px; padding: 12px 14px; margin-bottom: 18px; font-size: 12px; line-height: 1.6; }
.flash { border-radius: 12px; padding: 12px 15px; margin: 0 0 16px; font-size: 13px; }
.flash-success { color: #05603a; background: #e9f8f1; border: 1px solid #b7ebd3; }
.flash-error { color: var(--danger); background: var(--danger-soft); border: 1px solid #ffd2cc; }
.auth-footer { text-align: center; color: #98a2b3; font-size: 11px; padding-top: 8px; }

.register-shell { flex: 1; display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: start; padding: 20px 0 48px; }
.register-intro { padding-top: 55px; }
.register-intro h1 { font-size: clamp(38px, 4.4vw, 56px); }
.setup-steps { margin-top: 34px; display: grid; gap: 14px; }
.setup-step { display: flex; gap: 12px; align-items: center; color: #98a2b3; }
.setup-step > span { width: 34px; height: 34px; border-radius: 10px; background: #eef1f4; display: grid; place-items: center; font-weight: 800; font-size: 11px; }
.setup-step strong, .setup-step small { display: block; }
.setup-step strong { font-size: 13px; }
.setup-step small { font-size: 11px; margin-top: 2px; }
.setup-step.active { color: var(--text); }
.setup-step.active > span { background: var(--primary); color: white; }
.register-card { max-width: 650px; justify-self: end; width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.span-2 { grid-column: span 2; }
.form-section-title { margin: 25px 0 13px; color: #344054; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.form-section-title:first-of-type { margin-top: 0; }
.password-hint { color: #7c8798; font-size: 11px; margin: -5px 0 15px; line-height: 1.5; }
.terms { margin-top: 4px; }

.app-body { background: #f4f6f8; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: white; padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; }
.brand-sidebar { color: white; padding: 0 7px 20px; }
.brand-sidebar small { color: var(--sidebar-muted); }
.nav-list { display: grid; gap: 4px; margin-top: 14px; }
.nav-item { min-height: 43px; padding: 0 11px; border-radius: 10px; display: flex; align-items: center; gap: 11px; text-decoration: none; color: #cbd8da; font-size: 13px; font-weight: 600; }
.nav-item span { width: 18px; text-align: center; color: #91aaa9; }
.nav-item em { margin-left: auto; font-style: normal; font-size: 8px; text-transform: uppercase; color: #668084; }
.nav-item.active { background: rgba(255,255,255,.09); color: white; }
.nav-item.active span { color: #90dfca; }
.nav-item.disabled { cursor: default; }
.nav-caption { color: #668084; text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .13em; padding: 20px 11px 6px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 15px; }
.org-pill { display: flex; gap: 10px; align-items: center; padding: 8px; }
.avatar, .user-avatar { display: grid; place-items: center; border-radius: 10px; font-weight: 800; }
.avatar { width: 34px; height: 34px; background: rgba(144,223,202,.13); color: #90dfca; }
.org-pill strong, .org-pill small { display: block; }
.org-pill strong { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.org-pill small { color: var(--sidebar-muted); font-size: 9px; margin-top: 3px; text-transform: uppercase; }
.main-content { min-width: 0; }
.topbar { height: 72px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 30px; position: sticky; top: 0; z-index: 20; }
.topbar-spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.user-meta strong, .user-meta small { display: block; }
.user-meta strong { font-size: 11px; }
.user-meta small { color: #98a2b3; font-size: 9px; margin-top: 2px; }
.mobile-menu { display: none; border: 0; background: #f2f4f7; width: 38px; height: 38px; border-radius: 9px; }
.page-content { padding: 34px 34px 45px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-content > .flash { margin-bottom: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 27px; }
.page-head h1 { font-size: 30px; margin: 8px 0 7px; letter-spacing: -.035em; }
.page-head p { color: var(--muted); margin: 0; font-size: 13px; }
.trial-badge { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 11px 15px; min-width: 160px; }
.trial-badge span, .trial-badge strong, .trial-badge small { display: block; }
.trial-badge span { color: #98a2b3; font-size: 9px; text-transform: uppercase; }
.trial-badge strong { font-size: 13px; margin-top: 3px; text-transform: capitalize; }
.trial-badge small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.stat-card, .panel { background: white; border: 1px solid var(--line); border-radius: 15px; }
.stat-card { padding: 19px; min-height: 126px; }
.stat-label { display: block; color: #98a2b3; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-card strong { display: block; font-size: 22px; letter-spacing: -.03em; margin: 19px 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stat-card small { color: var(--muted); font-size: 10px; }
.content-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px; margin-top: 15px; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { font-size: 18px; margin: 7px 0 0; letter-spacing: -.02em; }
.status-dot { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.module-list { display: grid; }
.module-row { min-height: 70px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; border-top: 1px solid #edf0f3; color: #667085; }
.module-row:first-child { border-top: 0; }
.module-number { color: #98a2b3; font-size: 10px; font-weight: 800; }
.module-row strong, .module-row small { display: block; }
.module-row strong { font-size: 12px; color: #344054; }
.module-row small { font-size: 10px; margin-top: 4px; }
.module-row b { font-size: 9px; color: #98a2b3; }
.module-row.done b { color: var(--success); font-size: 16px; }
.module-row.next { background: linear-gradient(90deg, rgba(234,246,242,.6), transparent); }
.module-row.next b { color: var(--primary); }
.permission-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-cloud span { background: #f6f8fa; color: #475467; border: 1px solid #e7ebef; padding: 6px 8px; border-radius: 7px; font-size: 9px; }
.app-footer { color: #98a2b3; font-size: 10px; padding: 0 34px 22px; }

@media (max-width: 980px) {
    .auth-grid, .register-shell { grid-template-columns: 1fr; gap: 34px; }
    .auth-hero, .register-intro { max-width: 720px; padding-top: 10px; }
    .auth-card-wrap, .register-card { max-width: 720px; justify-self: stretch; }
    .auth-hero h1, .register-intro h1 { font-size: 44px; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -275px; width: 260px; transition: left .2s ease; box-shadow: 12px 0 30px rgba(0,0,0,.18); }
    .sidebar-open .sidebar { left: 0; }
    .mobile-menu { display: block; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .auth-shell { width: min(100% - 24px, 1220px); padding-top: 18px; }
    .auth-brand-wrap { margin-bottom: 10px; }
    .auth-grid, .register-shell { padding-top: 8px; }
    .auth-hero h1, .register-intro h1 { font-size: 36px; }
    .auth-hero > p, .register-intro > p { font-size: 14px; }
    .auth-card, .register-card { padding: 22px; border-radius: 18px; }
    .grid-2 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .topbar { padding: 0 14px; }
    .user-meta { display: none; }
    .page-content { padding: 24px 14px 38px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .trial-badge { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .panel { padding: 17px; }
    .module-row { grid-template-columns: 32px 1fr; padding: 10px 0; }
    .module-row b { grid-column: 2; }
}

/* ===== Modul 02: echipă, roluri, organizație ===== */
button, input, select, textarea { font: inherit; }
select, textarea { color: var(--text); }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f4c5c0; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-secondary { background: #eef6f3; color: var(--primary); border: 1px solid #cde3dc; }
.btn-secondary:hover { background: #e3f1ec; }
.btn-icon { min-width: 38px; min-height: 36px; padding: 0 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field select, .field textarea {
    width: 100%; border: 1px solid #d7dde5; border-radius: 11px; padding: 0 14px; background: #fff; outline: none; transition: .15s ease;
}
.field select { height: 48px; }
.field textarea { min-height: 102px; padding-top: 12px; resize: vertical; }
.field select:focus, .field textarea:focus { border-color: #82b5aa; box-shadow: 0 0 0 4px rgba(23,107,91,.08); }
.help-text { margin: -7px 0 16px; color: #7c8798; font-size: 11px; line-height: 1.55; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.table-panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.table-toolbar { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.table-toolbar h2 { margin: 0; font-size: 17px; }
.table-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 12px 18px; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; color: #7c8798; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 15px 18px; border-bottom: 1px solid #edf0f3; vertical-align: middle; font-size: 12px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfd; }
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.mini-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.cell-user strong, .cell-user small { display: block; }
.cell-user strong { font-size: 12px; }
.cell-user small { color: #98a2b3; margin-top: 3px; font-size: 10px; }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.badge-success { color: #05603a; background: #e9f8f1; }
.badge-muted { color: #667085; background: #f1f3f5; }
.badge-warning { color: #8a4b08; background: #fff4dc; }
.badge-danger { color: #b42318; background: var(--danger-soft); }
.role-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.role-tag { background: #f5f7f9; border: 1px solid #e5e9ef; color: #475467; border-radius: 7px; padding: 4px 7px; font-size: 9px; white-space: nowrap; }
.empty-state { padding: 46px 20px; text-align: center; }
.empty-state strong { display: block; font-size: 16px; margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 0 auto 17px; max-width: 420px; }
.section-gap { margin-top: 16px; }

.form-panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; }
.form-panel h2 { margin: 0 0 5px; font-size: 18px; }
.form-panel > p, .form-intro { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-columns { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(260px,.6fr); gap: 16px; align-items: start; }
.side-panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.side-panel h3 { margin: 0 0 8px; font-size: 14px; }
.side-panel p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.info-list { display: grid; gap: 11px; margin-top: 17px; }
.info-line { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid #edf0f3; padding-top: 11px; font-size: 11px; }
.info-line span { color: var(--muted); }
.info-line strong { text-align: right; }

.role-selector { display: grid; gap: 9px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid #e4e7ec; border-radius: 11px; cursor: pointer; }
.role-option:hover { border-color: #bbd6cf; background: #fbfdfc; }
.role-option input { margin-top: 2px; accent-color: var(--primary); }
.role-option strong, .role-option small { display: block; }
.role-option strong { font-size: 12px; }
.role-option small { color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 3px; }

.permission-matrix { display: grid; gap: 12px; margin-top: 18px; }
.permission-group { border: 1px solid #e4e7ec; border-radius: 12px; overflow: hidden; }
.permission-group-head { padding: 11px 13px; background: #f8fafb; border-bottom: 1px solid #e8ecf0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.permission-group-head strong { font-size: 11px; text-transform: capitalize; }
.permission-items { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.permission-item { display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border-bottom: 1px solid #edf0f3; }
.permission-item:nth-child(odd) { border-right: 1px solid #edf0f3; }
.permission-item input { margin-top: 2px; accent-color: var(--primary); }
.permission-item strong, .permission-item small { display: block; }
.permission-item strong { font-size: 11px; }
.permission-item small { color: #98a2b3; font-size: 9px; margin-top: 3px; line-height: 1.45; }

.invite-link-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 14px 0; }
.invite-link-box input { min-width: 0; height: 44px; border: 1px solid #d7dde5; border-radius: 10px; padding: 0 12px; background: #f9fafb; font-size: 11px; }
.callout { border-radius: 12px; padding: 14px 16px; font-size: 11px; line-height: 1.6; }
.callout-info { background: #f0f7ff; border: 1px solid #cfe4fb; color: #315b7d; }
.callout-warning { background: #fff8e7; border: 1px solid #f3dfad; color: #795516; }

.roles-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px; display: flex; flex-direction: column; min-height: 205px; }
.role-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.role-card h3 { margin: 0; font-size: 15px; }
.role-card p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 8px 0 18px; }
.role-card-stats { display: flex; gap: 20px; margin-top: auto; border-top: 1px solid #edf0f3; padding-top: 13px; }
.role-card-stats span, .role-card-stats strong { display: block; }
.role-card-stats span { color: #98a2b3; font-size: 9px; text-transform: uppercase; }
.role-card-stats strong { font-size: 14px; margin-top: 3px; }
.role-card-actions { display: flex; gap: 7px; margin-top: 13px; }

@media (max-width: 1100px) {
    .roles-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-columns { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .roles-grid { grid-template-columns: 1fr; }
    .permission-items { grid-template-columns: 1fr; }
    .permission-item:nth-child(odd) { border-right: 0; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .invite-link-box { grid-template-columns: 1fr; }
}
