/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --zinc-50: #e0eaf4; 
    --zinc-100: #c8d8e8;
    --zinc-200: #a8bed6;
    --zinc-300: #d4d4d8;
    --zinc-400: #a1a1aa;
    --zinc-500: #71717a;
    --zinc-600: #52525b;
    --zinc-700: #3f3f46;
    --zinc-800: #27272a;
    --zinc-900: #18181b;
    --zinc-950: #09090b;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --emerald-100: #d1fae5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --rose-100: #ffe4e6;
    --rose-300: #fda4af;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --white: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--zinc-50);
    color: var(--zinc-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; }

/* ===== LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 200px;
    background: var(--zinc-950);
    border-right: 1px solid var(--zinc-900);
    display: flex;
    flex-direction: column;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(24,24,27,.5);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--zinc-800);
}

.sidebar-logo span {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.025em;
}

.sidebar-close {
    color: var(--zinc-400);
    padding: 4px;
    transition: color .2s;
}

.sidebar-close:hover {
    color: var(--white);
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-nav {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-400);
    transition: all .2s;
}

.nav-item i {
    width: 20px;
    height: 20px;
    color: var(--zinc-500);
}

.nav-item:hover {
    background: var(--zinc-900);
    color: var(--zinc-100);
}

.nav-item.active {
    background: var(--amber-500);
    color: var(--zinc-950);
    box-shadow: 0 4px 6px -1px rgba(245,158,11,.2);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--zinc-950);
}

.sidebar-footer {
    padding: 0 16px;
    margin-top: 32px;
}

.sidebar-profile {
    padding: 16px;
    border-radius: 12px;
    background: var(--zinc-900);
    border: 1px solid rgba(39,39,42,.5);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--zinc-800);
}

.sidebar-profile-info p:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
}

.sidebar-profile-info p:last-child {
    font-size: 12px;
    color: var(--amber-500);
}

.sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-400);
    transition: all .2s;
}

.sidebar-btn i {
    width: 20px;
    height: 20px;
    color: var(--zinc-500);
}

.sidebar-btn:hover {
    background: var(--zinc-900);
    color: var(--zinc-100);
}

.sidebar-btn.logout {
    color: var(--rose-400);
    margin-top: 4px;
}

.sidebar-btn.logout:hover {
    color: var(--rose-300);
    background: var(--zinc-900);
}

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(24,24,27,.8);
    backdrop-filter: blur(4px);
    z-index: 20;
}

.sidebar-backdrop.show {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--zinc-50);
    margin-left: 0;
}

/* ===== HEADER ===== */
.header {
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--zinc-200);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    padding: 8px;
    color: var(--zinc-500);
    border-radius: 8px;
    transition: all .2s;
}

.menu-toggle:hover {
    color: var(--zinc-900);
    background: var(--zinc-100);
}

.search-box {
    display: none;
    position: relative;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--zinc-400);
    z-index: 1;
    pointer-events: none;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    width: 288px;
    outline: none;
    transition: all .2s;
}

.search-box input:focus {
    box-shadow: 0 0 0 2px var(--amber-500);
    border-color: var(--amber-500);
    background: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-btn {
    position: relative;
    padding: 8px;
    color: var(--zinc-400);
    border-radius: 50%;
    transition: all .2s;
}

.notif-btn:hover {
    color: var(--zinc-600);
    background: var(--zinc-100);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--rose-500);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.header-user {
    display: none;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--zinc-200);
}

.header-user-info {
    text-align: right;
}

.header-user-info p:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--zinc-900);
}

.header-user-info p:last-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--amber-600);
}

.header-info-item {
    display: none;
}

.header-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

/* ===== MAIN AREA ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--zinc-900);
}

.page-header p {
    font-size: 14px;
    color: var(--zinc-500);
    margin-top: 4px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
    white-space: nowrap;
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--amber-500);
    color: var(--zinc-950);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--amber-400);
}

.btn-secondary {
    background: var(--white);
    color: var(--zinc-700);
    border: 1px solid var(--zinc-300);
}

.btn-secondary:hover {
    background: var(--zinc-50);
}

.btn-outline {
    background: transparent;
    color: var(--zinc-600);
    border: 1px solid var(--zinc-200);
}

.btn-outline:hover {
    background: var(--zinc-50);
}

.btn-amber-light {
    background: rgba(245,158,11,.1);
    color: var(--amber-700);
    font-weight: 700;
}

.btn-amber-light:hover {
    background: rgba(245,158,11,.2);
}

.btn-download {
    background: transparent;
    color: var(--amber-600);
    border: 1px solid var(--zinc-200);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.btn-download:hover {
    background: var(--amber-50);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--zinc-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--zinc-900);
}

.card-header-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--amber-600);
    transition: color .2s;
}

.card-header-link:hover {
    color: var(--amber-700);
}

.card-body {
    padding: 24px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-icon.zinc { background: var(--zinc-100); color: var(--zinc-900); }
.stat-icon.emerald { background: var(--emerald-100); color: var(--emerald-600); }
.stat-icon.amber { background: var(--amber-100); color: var(--amber-600); }

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.stat-change i {
    width: 16px;
    height: 16px;
}

.stat-change.up { color: var(--emerald-600); }
.stat-change.down { color: var(--rose-600); }

.stat-card-bottom {
    margin-top: 16px;
}

.stat-card-bottom h3 {
    font-size: 30px;
    font-weight: 700;
    color: var(--zinc-900);
}

.stat-card-bottom p {
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-500);
    margin-top: 4px;
}

/* ===== CHARTS ===== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--zinc-900);
}

.chart-header p {
    font-size: 14px;
    color: var(--zinc-500);
}

.chart-header select {
    font-size: 14px;
    border: 1px solid var(--zinc-200);
    border-radius: 6px;
    padding: 4px 8px;
    background: var(--zinc-50);
    outline: none;
}

.chart-header select:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 2px rgba(245,158,11,.2);
}

.chart-container {
    height: 288px;
    position: relative;
}

/* ===== TABLES ===== */
.table-wrapper {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-toolbar {
    padding: 16px;
    border-bottom: 1px solid var(--zinc-200);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-search {
    position: relative;
    width: 100%;
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--zinc-400);
}

.table-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--zinc-200);
    border-radius: 8px;
    font-size: 14px;
    background: var(--zinc-50);
    outline: none;
}

.table-search input:focus {
    box-shadow: 0 0 0 2px var(--amber-500);
    border-color: transparent;
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-filters select {
    font-size: 14px;
    border: 1px solid var(--zinc-200);
    border-radius: 8px;
    padding: 8px 40px 8px 12px;
    background: var(--zinc-50);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.table-filters select:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 2px rgba(245,158,11,.2);
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: var(--zinc-600);
}

thead {
    background: var(--zinc-50);
    border-bottom: 1px solid var(--zinc-200);
}

thead th {
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--zinc-500);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--zinc-200);
    transition: background .15s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--zinc-50);
}

tbody td {
    padding: 16px 24px;
    white-space: nowrap;
}

.table-footer {
    padding: 16px;
    border-top: 1px solid var(--zinc-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--zinc-500);
}

.table-footer-btns {
    display: flex;
    gap: 8px;
}

.table-footer-btns button {
    padding: 4px 12px;
    border: 1px solid var(--zinc-200);
    border-radius: 4px;
    font-size: 14px;
    color: var(--zinc-600);
    transition: background .15s;
}

.table-footer-btns button:hover {
    background: var(--zinc-50);
}

/* ===== TABLE CELL HELPERS ===== */
.cell-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--zinc-200);
}

.cell-user-name {
    font-weight: 500;
    color: var(--zinc-900);
}

.cell-user-email {
    color: var(--zinc-500);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 13px;
}

.cell-user-email i {
    width: 12px;
    height: 12px;
}

.cell-group {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--zinc-600);
}

.cell-group i {
    width: 16px;
    height: 16px;
    color: var(--zinc-400);
}

.cell-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.active { background: var(--emerald-500); }
.status-dot.pending { background: var(--zinc-300); }

.cell-actions {
    text-align: right;
}

.cell-actions button {
    color: var(--zinc-400);
    padding: 4px;
    border-radius: 4px;
    transition: all .15s;
}

.cell-actions button:hover {
    color: var(--amber-600);
    background: var(--zinc-100);
}

.cell-actions button i {
    width: 20px;
    height: 20px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-emerald {
    background: var(--emerald-100);
    color: var(--emerald-700);
}

.badge-amber {
    background: var(--amber-100);
    color: var(--amber-700);
}

.badge-zinc {
    background: var(--zinc-100);
    color: var(--zinc-700);
}

.badge-rose {
    background: var(--rose-100);
    color: var(--rose-600);
}

/* ===== TASK LIST (Dashboard) ===== */
.task-item {
    padding: 16px;
    transition: background .15s;
    border-bottom: 1px solid var(--zinc-200);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background: var(--zinc-50);
}

.task-item-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.task-item-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.task-dot {
    margin-top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-dot.completed { background: var(--emerald-500); }
.task-dot.in-progress { background: var(--amber-500); }
.task-dot.pending { background: var(--zinc-300); }

.task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--zinc-900);
}

.task-desc {
    font-size: 14px;
    color: var(--zinc-500);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-assignee img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.task-assignee span {
    font-size: 12px;
    font-weight: 500;
    color: var(--zinc-600);
}

.task-meta .divider {
    font-size: 12px;
    color: var(--zinc-400);
}

.task-meta .due {
    font-size: 12px;
    color: var(--zinc-500);
}

/* ===== TOP PERFORMERS ===== */
.performer-item {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background .15s;
    border-bottom: 1px solid var(--zinc-200);
}

.performer-item:last-child {
    border-bottom: none;
}

.performer-item:hover {
    background: var(--zinc-50);
}

.performer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.performer-avatar {
    position: relative;
}

.performer-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.performer-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--amber-400);
    border-radius: 50%;
    border: 2px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.performer-crown i {
    width: 10px;
    height: 10px;
    color: var(--white);
}

.performer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--zinc-900);
}

.performer-email {
    font-size: 12px;
    color: var(--zinc-500);
}

.performer-right {
    text-align: right;
}

.performer-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--zinc-900);
}

.performer-label {
    font-size: 12px;
    color: var(--zinc-500);
}

/* ===== GRIDS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* ===== ORG CARDS ===== */
.org-card {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: box-shadow .2s;
}

.org-card:hover {
    box-shadow: var(--shadow-md);
}

.org-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.org-icon {
    width: 48px;
    height: 48px;
    background: var(--zinc-950);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amber-500);
    font-size: 20px;
    font-weight: 700;
}

.org-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--zinc-900);
    margin-bottom: 4px;
}

.org-employees {
    font-size: 14px;
    color: var(--zinc-500);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.org-employees i {
    width: 16px;
    height: 16px;
}

.org-avatars {
    display: flex;
    margin-bottom: 24px;
}

.org-avatars img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--white);
    object-fit: cover;
    margin-left: -8px;
}

.org-avatars img:first-child {
    margin-left: 0;
}

.org-avatars-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: var(--zinc-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--zinc-600);
    margin-left: -8px;
}

.org-card-actions {
    display: flex;
    gap: 12px;
}

.org-card-actions .btn {
    flex: 1;
}

/* ===== FORMS ===== */
.form-page {
    max-width: 672px;
    margin: 0 auto;
}

.form-page.wide {
    max-width: 896px;
}

.form-back {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.form-back-btn {
    padding: 8px;
    border-radius: 8px;
    transition: background .15s;
    color: var(--zinc-600);
}

.form-back-btn:hover {
    background: var(--zinc-100);
}

.form-back-btn i {
    width: 20px;
    height: 20px;
}

.form-card {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--zinc-200);
    border-radius: 8px;
    background: var(--zinc-50);
    font-size: 14px;
    outline: none;
    transition: all .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 2px var(--amber-500);
    background: var(--white);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--zinc-200);
    margin-top: 24px;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    display: flex;
    justify-content: center;
    padding: 20px 24px;
    border: 2px dashed var(--zinc-300);
    border-radius: 8px;
    background: var(--zinc-50);
    cursor: pointer;
    transition: background .15s;
}

.file-upload:hover {
    background: var(--zinc-100);
}

.file-upload-inner {
    text-align: center;
}

.file-upload-inner i {
    width: 48px;
    height: 48px;
    color: var(--zinc-400);
    margin: 0 auto 16px;
}

.file-upload-inner .file-text {
    font-size: 14px;
    color: var(--zinc-600);
}

.file-upload-inner .file-text span {
    font-weight: 500;
    color: var(--amber-600);
}

.file-upload-inner .file-hint {
    font-size: 12px;
    color: var(--zinc-500);
    margin-top: 8px;
}

.file-upload input[type="file"] {
    display: none;
}

/* ===== ORG FORM SIDEBAR ===== */
.org-form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.employee-select-panel {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 500px;
}

.employee-select-header {
    padding: 16px;
    border-bottom: 1px solid var(--zinc-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(250,250,250,.5);
    border-radius: 12px 12px 0 0;
}

.employee-select-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.employee-select-header-left i {
    width: 20px;
    height: 20px;
    color: var(--zinc-500);
}

.employee-select-header-left h3 {
    font-weight: 600;
    color: var(--zinc-900);
    font-size: 14px;
}

.employee-select-count {
    background: var(--amber-100);
    color: var(--amber-700);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 9999px;
}

.employee-select-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-select-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    transition: all .2s;
    border: 1px solid transparent;
    text-align: left;
}

.employee-select-item:hover {
    background: var(--zinc-50);
}

.employee-select-item.selected {
    background: var(--amber-50);
    border-color: var(--amber-200);
    box-shadow: var(--shadow-sm);
}

.employee-select-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-select-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.employee-select-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-900);
}

.employee-select-item.selected .employee-select-item-name {
    color: var(--amber-700);
}

.employee-select-item-group {
    font-size: 12px;
    color: var(--zinc-500);
}

.employee-select-item.selected .employee-select-item-group {
    color: var(--amber-600);
}

.employee-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--zinc-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.employee-select-item.selected .employee-check {
    background: var(--amber-500);
    border-color: var(--amber-500);
}

.employee-check i {
    width: 12px;
    height: 12px;
    color: var(--white);
    display: none;
}

.employee-select-item.selected .employee-check i {
    display: block;
}

/* ===== MESSAGES PAGE ===== */
.messages-container {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 8rem);
}

.messages-sidebar {
    width: 100%;
    border-bottom: 1px solid var(--zinc-200);
    display: flex;
    flex-direction: column;
    background: var(--zinc-50);
    max-height: 300px;
}

.messages-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--zinc-200);
    background: var(--white);
}

.messages-sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--zinc-900);
    margin-bottom: 16px;
}

.messages-sidebar-header .table-search {
    width: 100%;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
}

.message-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--zinc-100);
    border-left: 4px solid transparent;
}

.message-item:hover {
    background: var(--zinc-100);
}

.message-item.active {
    background: var(--amber-50);
    border-left-color: var(--amber-500);
}

.message-avatar {
    position: relative;
    flex-shrink: 0;
}

.message-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--zinc-200);
}

.message-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.message-status-dot.online { background: var(--emerald-500); }
.message-status-dot.offline { background: var(--zinc-300); }

.message-content {
    flex: 1;
    min-width: 0;
}

.message-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.message-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--zinc-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-time {
    font-size: 12px;
    color: var(--zinc-500);
    flex-shrink: 0;
}

.message-preview {
    font-size: 12px;
    color: var(--zinc-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: none;
    flex-direction: column;
    background: var(--white);
}

.chat-header {
    height: 64px;
    border-bottom: 1px solid var(--zinc-200);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-left img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--zinc-200);
}

.chat-header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--zinc-900);
}

.chat-header-status {
    font-size: 12px;
    color: var(--emerald-600);
    font-weight: 500;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--zinc-400);
}

.chat-header-actions button {
    color: var(--zinc-400);
    transition: color .2s;
}

.chat-header-actions button:hover {
    color: var(--amber-600);
}

.chat-header-actions button i {
    width: 20px;
    height: 20px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(250,250,250,.5);
}

.chat-date {
    display: flex;
    justify-content: center;
}

.chat-date span {
    font-size: 12px;
    font-weight: 500;
    color: var(--zinc-400);
    background: var(--zinc-100);
    padding: 4px 12px;
    border-radius: 9999px;
}

.chat-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-bubble-row.incoming {}
.chat-bubble-row.outgoing {
    justify-content: flex-end;
}

.chat-bubble-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.chat-bubble {
    padding: 12px;
    border-radius: 16px;
    max-width: 448px;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.incoming {
    background: var(--white);
    border: 1px solid var(--zinc-200);
    border-bottom-left-radius: 0;
}

.chat-bubble.outgoing {
    background: var(--amber-500);
    color: var(--zinc-950);
    border-bottom-right-radius: 0;
}

.chat-bubble p {
    font-size: 14px;
}

.chat-bubble.outgoing p {
    font-weight: 500;
}

.chat-bubble .bubble-time {
    font-size: 10px;
    margin-top: 4px;
    display: block;
}

.chat-bubble.incoming .bubble-time {
    color: var(--zinc-400);
}

.chat-bubble.outgoing .bubble-time {
    color: var(--zinc-800);
    text-align: right;
}

.chat-attachment {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--zinc-50);
    border-radius: 8px;
    border: 1px solid var(--zinc-100);
}

.chat-attachment-icon {
    width: 32px;
    height: 32px;
    background: var(--rose-100);
    color: var(--rose-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.chat-attachment-info p:first-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--zinc-900);
}

.chat-attachment-info p:last-child {
    font-size: 10px;
    color: var(--zinc-500);
}

/* Chat Input */
.chat-input {
    padding: 16px;
    border-top: 1px solid var(--zinc-200);
    background: var(--white);
}

.chat-input-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px 16px;
    background: var(--zinc-50);
    border: 1px solid var(--zinc-200);
    border-radius: 9999px;
    font-size: 14px;
    outline: none;
    transition: all .2s;
}

.chat-input input:focus {
    box-shadow: 0 0 0 2px var(--amber-500);
    background: var(--white);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--amber-500);
    color: var(--zinc-950);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
    box-shadow: var(--shadow-sm);
}

.chat-send-btn:hover {
    background: var(--amber-400);
}

.chat-send-btn i {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* ===== GROUP TABLE ICON ===== */
.group-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--amber-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amber-600);
}

.group-icon i {
    width: 20px;
    height: 20px;
}

/* ===== REPORT FILE ICON ===== */
.file-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon i {
    width: 16px;
    height: 16px;
}

.file-icon.pdf {
    background: var(--rose-100);
    color: var(--rose-600);
}

.file-icon.excel {
    background: var(--emerald-100);
    color: var(--emerald-600);
}

/* ===== TASK TABLE HELPERS ===== */
.cell-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--zinc-500);
}

.cell-date i {
    width: 16px;
    height: 16px;
}

.cell-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cell-assignee img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--zinc-200);
}

.cell-assignee span {
    font-weight: 500;
    color: var(--zinc-700);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
    .main-content {
        padding: 24px;
    }

    .header {
        padding: 0 24px;
    }

    .search-box {
        display: flex;
    }

    .header-right {
        gap: 20px;
    }

    .header-user {
        display: flex;
    }

    .header-info-item {
        display: block !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .table-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .table-search {
        width: 288px;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .messages-container {
        flex-direction: row;
    }

    .messages-sidebar {
        width: 320px;
        border-bottom: none;
        border-right: 1px solid var(--zinc-200);
        max-height: none;
    }

    .chat-area {
        display: flex;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sidebar {
        position: static;
        transform: translateX(0);
    }

    .sidebar-close {
        display: none;
    }

    .menu-toggle {
        display: none;
    }

    .main-content {
        padding: 32px;
    }

    .header {
        padding: 0 32px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .charts-row {
        grid-template-columns: 2fr 1fr;
    }

    .org-form-layout {
        grid-template-columns: 2fr 1fr;
    }
}

@media (min-width: 1280px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
