/* ============================================================
   APROSHAV Admin — Feuille de style principale
   Couleurs : #006633 (vert) + #cc0000 (rouge) + neutres
   ============================================================ */

:root {
  --green:       #006633;
  --green-light: #008844;
  --green-pale:  #e8f5ee;
  --red:         #cc0000;
  --red-light:   #e53e3e;
  --red-pale:    #fff0f0;
  --sidebar-w:   260px;
  --header-h:    64px;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-md:   0 4px 24px rgba(0,0,0,.12);
  --border:      #e5e7eb;
  --bg:          #f4f6f9;
  --card-bg:     #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --transition:  all .2s ease;
  --font:        'Sora', sans-serif;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
input, select, textarea, button { font-family: var(--font); }

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(175deg, #003d1f 0%, #006633 60%, #004d26 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-logo {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  display: block;
}
.brand-sub {
  font-size: .68rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.user-avatar-wrap { position: relative; flex-shrink: 0; }
.user-avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.3);
}
.user-status-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: #22c55e;
  border-radius: 50%;
  border: 1.5px solid #006633;
}
.user-name-sm {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  display: block;
}
.user-role-badge {
  font-size: .65rem;
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  padding: 1px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav {
  padding: 12px 12px;
  flex: 1;
}
.nav-section-label {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  font-weight: 400;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: #fff;
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; text-align: center; font-size: .9rem; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-logout { color: rgba(255,150,150,.8); margin-top: 8px; }
.nav-logout:hover { background: rgba(204,0,0,.2); color: #ff8080; }

/* ============ MAIN WRAPPER ============ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ============ TOP HEADER ============ */
.top-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.sidebar-toggle:hover { border-color: var(--green); color: var(--green); }
.breadcrumb-page { font-size: .9rem; font-weight: 600; color: var(--text); }

.header-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
  font-size: .95rem;
}
.icon-btn:hover { background: var(--green-pale); color: var(--green); }
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--red);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

/* Dropdown notifications */
.header-notif { position: relative; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.header-notif.open .notif-dropdown { display: block; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .85rem;
}
.notif-mark-all { font-size: .75rem; color: var(--green); }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item.unread { background: var(--green-pale); }
.notif-item:hover { background: #f9f9f9; }
.notif-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.type-success { background: #dcfce7; color: #16a34a; }
.type-warning { background: #fef9c3; color: #ca8a04; }
.type-danger  { background: #fee2e2; color: #dc2626; }
.type-info    { background: #dbeafe; color: #2563eb; }
.notif-content { flex: 1; }
.notif-title { font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
.notif-msg { font-size: .75rem; color: var(--text-muted); }
.notif-time { font-size: .68rem; color: var(--text-muted); margin-top: 4px; display: block; }
.notif-empty { padding: 32px; text-align: center; color: var(--text-muted); }
.notif-empty i { font-size: 2rem; margin-bottom: 8px; display: block; }
.notif-empty p { font-size: .85rem; }

/* Dropdown profil */
.header-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.header-profile:hover { background: var(--bg); }
.header-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green);
}
.profile-info-header { display: flex; flex-direction: column; line-height: 1.3; }
.profile-name-header { font-size: .82rem; font-weight: 600; }
.profile-post-header { font-size: .7rem; color: var(--text-muted); }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.header-profile.open .profile-dropdown { display: block; }
.profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .84rem;
  color: var(--text);
  transition: var(--transition);
}
.profile-dropdown a:hover { background: var(--bg); }
.profile-dropdown a.text-danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ============ PAGE CONTENT ============ */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ============ CARDS ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3, .card-header h4 {
  font-size: .92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i, .card-header h4 i { color: var(--green); }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

/* ============ STAT CARDS ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.admin-stats { margin-bottom: 12px; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
}
.accent-green::before  { background: #16a34a; }
.accent-blue::before   { background: #2563eb; }
.accent-orange::before { background: #f59e0b; }
.accent-red::before    { background: #dc2626; }
.accent-purple::before { background: #7c3aed; }
.accent-teal::before   { background: #0891b2; }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.accent-green .stat-icon  { background: #dcfce7; color: #16a34a; }
.accent-blue .stat-icon   { background: #dbeafe; color: #2563eb; }
.accent-orange .stat-icon { background: #fef3c7; color: #f59e0b; }
.accent-red .stat-icon    { background: #fee2e2; color: #dc2626; }
.accent-purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.accent-teal .stat-icon   { background: #cffafe; color: #0891b2; }

.stat-body { flex: 1; }
.stat-num { font-size: 1.5rem; font-weight: 700; display: block; line-height: 1; }
.stat-lbl { font-size: .72rem; color: var(--text-muted); margin-top: 3px; display: block; }
.stat-action {
  position: absolute;
  bottom: 8px; right: 12px;
  font-size: .72rem;
  color: var(--green);
  font-weight: 600;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-middle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.calendar-card .card-body { padding: 12px; }
.chart-card canvas { max-height: 240px; }

/* ============ MINI CALENDAR ============ */
.mini-calendar { font-size: .8rem; }
.mini-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
}
.mini-calendar-header button {
  background: var(--bg);
  border: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mini-calendar-header button:hover { background: var(--green); color: #fff; }
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day-name {
  text-align: center;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 600;
}
.cal-day {
  text-align: center;
  padding: 5px 2px;
  border-radius: 6px;
  cursor: default;
  transition: var(--transition);
  font-size: .78rem;
}
.cal-day.has-task {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.cal-day.today {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}
.cal-day.other-month { color: #d1d5db; }
.cal-month-title { font-size: .85rem; font-weight: 700; }

/* ============ DATA TABLE ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--bg);
  font-size: .83rem;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: none; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.table-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-success  { background: #dcfce7; color: #16a34a; }
.badge-primary  { background: #dbeafe; color: #2563eb; }
.badge-warning  { background: #fef3c7; color: #b45309; }
.badge-danger   { background: #fee2e2; color: #dc2626; }
.badge-secondary{ background: #f1f5f9; color: #64748b; }
.badge-lg { font-size: .8rem; padding: 5px 14px; }

/* ============ BUTTONS ============ */
.btn-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary-btn:hover { background: var(--green-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,51,.25); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
}
.btn-sm:hover { border-color: var(--green); color: var(--green); }
.btn-sm.btn-edit:hover { border-color: #2563eb; color: #2563eb; }
.btn-sm.btn-del:hover { border-color: var(--red); color: var(--red); }
.btn-icon-sm {
  width: 30px; height: 30px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text-muted);
}
.btn-icon-sm:hover { transform: scale(1.1); }
.btn-icon-sm.btn-success { background: #dcfce7; color: #16a34a; }
.btn-icon-sm.btn-warning { background: #fef3c7; color: #b45309; }
.btn-icon-sm.btn-danger  { background: #fee2e2; color: var(--red); }
.btn-icon-sm.btn-primary { background: #dbeafe; color: #2563eb; }
.action-btns { display: flex; gap: 5px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,102,51,.08); }
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  outline: none;
  resize: vertical;
}
.form-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,102,51,.08); }
.form-hint { font-size: .73rem; color: var(--text-muted); margin-top: 5px; display: block; }
.req { color: var(--red); }

/* ============ TOOLBAR ============ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-tab:hover { border-color: var(--green); color: var(--green); }
.filter-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.tab-count {
  background: rgba(255,255,255,.25);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
}
.filter-tab:not(.active) .tab-count { background: var(--bg); color: var(--text-muted); }
.pending-tab { background: var(--red) !important; color: #fff !important; }

.search-form { display: flex; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  min-width: 220px;
  transition: var(--transition);
}
.search-wrap:focus-within { border-color: var(--green); }
.search-wrap i { color: var(--text-muted); font-size: .85rem; }
.search-input {
  border: none;
  outline: none;
  background: none;
  font-size: .85rem;
  flex: 1;
  font-family: var(--font);
}

/* ============ ALERT BOXES ============ */
.alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-box.success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-box.danger  { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-box.warning { background: #fef9c3; color: #b45309; border: 1px solid #fde68a; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h4 { font-size: .95rem; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.modal-close:hover { background: var(--red-pale); color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ============ TASKS GRID ============ */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.task-card.priority-urgente { border-left-color: var(--red); }
.task-card.priority-elevee  { border-left-color: #f59e0b; }
.task-card.priority-moyenne { border-left-color: #2563eb; }
.task-card.priority-faible  { border-left-color: #16a34a; }
.task-card-top { display: flex; gap: 6px; margin-bottom: 10px; }
.task-card-title { font-size: .9rem; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.task-card-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.task-card-meta span { font-size: .76rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.task-card-actions { display: flex; gap: 6px; }

/* ============ TASK DETAIL ============ */
.task-detail-wrap { max-width: 1100px; }
.task-detail-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.task-detail-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.task-detail-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.task-detail-sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 16px; }
.task-detail-actions { display: flex; gap: 10px; }
.task-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.task-detail-main .card { margin-bottom: 0; }
.task-detail-side .card { margin-bottom: 16px; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--bg); font-size: .84rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-muted); }

/* ============ FILE LIST ============ */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .82rem;
}
.file-item i { font-size: 1.4rem; flex-shrink: 0; }
.file-info { flex: 1; }
.file-name { font-weight: 600; display: block; }
.file-meta { font-size: .72rem; color: var(--text-muted); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-top: 12px;
}
.upload-zone:hover { border-color: var(--green); background: var(--green-pale); }
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
  text-align: center;
}
.upload-label i { font-size: 2rem; color: var(--green); margin-bottom: 8px; }
.upload-label span { font-size: .85rem; font-weight: 500; color: var(--green); }
.upload-label small { font-size: .74rem; color: var(--text-muted); margin-top: 4px; }

/* ============ EVAL / RATING ============ */
.rating-display { margin-bottom: 20px; }
.rating-score { font-size: 3rem; font-weight: 800; line-height: 1; }
.rating-score span { font-size: 1.5rem; opacity: .7; }
.rating-bar-wrap { margin-top: 8px; }
.rating-bar-bg {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.rating-bar-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.rating-bar-wrap span { font-size: .74rem; color: var(--text-muted); }
.rating-comment { font-size: .84rem; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.eval-form-wrap { border-top: 1px solid var(--border); padding-top: 16px; }
.eval-form-wrap h5 { font-size: .88rem; font-weight: 600; margin-bottom: 14px; }
.score-input-row { display: flex; align-items: center; gap: 12px; }
.score-input-row input[type=range] { flex: 1; accent-color: var(--green); }
.score-display {
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 48px;
  text-align: center;
  color: var(--green);
}

/* ============ PERFORMANCE PAGE ============ */
.perf-my-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ranking-list { padding: 8px; }
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: var(--transition);
}
.ranking-item:hover { background: var(--bg); }
.ranking-item.top-1 { background: linear-gradient(90deg, #fefce8, #fff); border-color: #fde68a; }
.ranking-item.top-2 { background: linear-gradient(90deg, #f8fafc, #fff); border-color: #e2e8f0; }
.ranking-item.top-3 { background: linear-gradient(90deg, #fff7ed, #fff); border-color: #fed7aa; }
.rank-position { width: 30px; text-align: center; flex-shrink: 0; }
.rank-medal { font-size: 1.3rem; }
.rank-num { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.rank-info { flex: 1; }
.rank-info strong { font-size: .85rem; display: block; }
.rank-info small { font-size: .73rem; color: var(--text-muted); }
.rank-stats { width: 120px; }
.rank-bar-bg { height: 6px; background: var(--bg); border-radius: 3px; margin-bottom: 3px; overflow: hidden; }
.rank-bar-fill { height: 100%; border-radius: 3px; }
.rank-score-text { font-size: .75rem; font-weight: 700; color: var(--text); }
.rank-meta { min-width: 80px; text-align: right; }
.rank-meta span { font-size: .73rem; color: var(--text-muted); }

/* ============ PROFILE PAGE ============ */
.profile-page-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.profile-card-main {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: fit-content;
}
.profile-card-bg { height: 80px; background: linear-gradient(135deg, var(--green), #004422); }
.profile-card-body { padding: 0 20px 24px; text-align: center; }
.profile-avatar-wrap {
  display: inline-block;
  margin-top: -40px;
  margin-bottom: 10px;
}
.profile-avatar-wrap img {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
}
.profile-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.profile-poste { font-size: .8rem; color: var(--text-muted); margin-bottom: 10px; }
.profile-stats-mini {
  display: flex;
  justify-content: space-around;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 14px 0;
}
.profile-stats-mini div { display: flex; flex-direction: column; align-items: center; }
.profile-stats-mini strong { font-size: 1.1rem; font-weight: 700; }
.profile-stats-mini small { font-size: .68rem; color: var(--text-muted); }
.profile-contact-info { text-align: left; }
.profile-contact-info p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.profile-contact-info p i { color: var(--green); width: 14px; }

/* ============ FORM PAGE ============ */
.form-page-wrap { max-width: 820px; margin: 0 auto; }
.form-page-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--green-pale), #fff);
}
.form-page-icon {
  width: 50px; height: 50px;
  background: var(--green);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.form-page-header h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 3px; }
.form-page-header p { font-size: .82rem; color: var(--text-muted); }
.task-form { padding: 0; }
.form-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--bg);
}
.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-actions {
  padding: 20px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============ AUTH PAGES ============ */
.auth-body { background: var(--bg); display: flex; min-height: 100vh; }
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100vh;
}
.auth-panel-left {
  background: linear-gradient(160deg, #003d1f 0%, #006633 50%, #004d26 100%);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-panel-content { position: relative; z-index: 1; }
.auth-logo-big { font-size: 4rem; margin-bottom: 16px; }
.auth-brand-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.auth-brand-full {
  font-size: .95rem;
  color: rgba(255,255,255,.8);
  line-height: 1.6;
  margin-bottom: 24px;
}
.auth-divider {
  width: 60px; height: 3px;
  background: rgba(255,255,255,.4);
  border-radius: 2px;
  margin-bottom: 20px;
}
.auth-motto {
  font-size: .88rem;
  color: rgba(255,255,255,.7);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 28px;
}
.auth-domains { display: flex; flex-wrap: wrap; gap: 10px; }
.domain-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: .78rem;
  color: rgba(255,255,255,.9);
}
.auth-panel-decoration { position: absolute; inset: 0; pointer-events: none; }
.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
}
.c1 { width: 400px; height: 400px; bottom: -150px; right: -100px; }
.c2 { width: 250px; height: 250px; top: -80px; right: 50px; }
.c3 { width: 150px; height: 150px; bottom: 100px; right: 200px; background: rgba(255,255,255,.04); }

.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #fff;
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-form-header { margin-bottom: 28px; }
.auth-form-header h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.auth-form-header p { font-size: .88rem; color: var(--text-muted); }

.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
}
.input-icon-wrap .form-input { padding-left: 38px; }
.input-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 4px;
}
.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,102,51,.3); }
.auth-link-text { text-align: center; font-size: .83rem; color: var(--text-muted); margin-top: 18px; }
.auth-link-text a { color: var(--green); font-weight: 600; }
.auth-admin-hint {
  margin-top: 20px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: .76rem;
  color: #92400e;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.auth-admin-hint i { flex-shrink: 0; margin-top: 2px; }

/* Signup */
.signup-container {
  width: 100%;
  max-width: 700px;
  margin: 40px auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.signup-header {
  text-align: center;
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, var(--green-pale), #fff);
  border-bottom: 1px solid var(--border);
}
.signup-logo { font-size: 2rem; display: block; margin-bottom: 8px; }
.signup-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.signup-header p { font-size: .83rem; color: var(--text-muted); }
.signup-form { padding: 24px; }
.signup-success {
  text-align: center;
  padding: 48px 24px;
}
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.signup-success h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.signup-success p { font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; }
.btn-back-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-back-login:hover { background: var(--green-light); }

/* ============ FLOATING ACTION BUTTON ============ */
.fab-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 250;
}
.fab-main {
  width: 52px; height: 52px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,102,51,.4);
  transition: var(--transition);
}
.fab-main:hover { background: var(--green-light); transform: scale(1.08); }
.fab-main.open { transform: rotate(45deg); background: var(--red); }
.fab-menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
}
.fab-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.fab-item {
  width: 42px; height: 42px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: .95rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}
.fab-item:hover { background: var(--green); color: #fff; transform: scale(1.1); }
.fab-item::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 52px;
  white-space: nowrap;
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .74rem;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
}
.fab-item:hover::before { opacity: 1; }

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: .84rem;
  min-width: 260px;
  animation: toastIn .25s ease;
}
.toast.success { border-left: 4px solid #16a34a; }
.toast.danger  { border-left: 4px solid var(--red); }
.toast.warning { border-left: 4px solid #f59e0b; }
.toast.info    { border-left: 4px solid #2563eb; }
.toast-icon.success { color: #16a34a; }
.toast-icon.danger  { color: var(--red); }
.toast-icon.warning { color: #f59e0b; }
.toast-icon.info    { color: #2563eb; }
.toast-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .8rem; }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ============ UTILS ============ */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--red) !important; }
.d-block { display: block; }
.dashboard-grid { display: flex; flex-direction: column; gap: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 70px; }
  .brand-text, .user-info-sm, .nav-item span, .nav-section-label { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.active::before { display: none; }
  .sidebar-brand { justify-content: center; padding: 18px 0; }
  .sidebar-user { justify-content: center; }
  .dashboard-middle, .perf-grid, .task-detail-grid { grid-template-columns: 1fr; }
  .profile-page-grid { grid-template-columns: 1fr; }
  .profile-card-main { position: static; }
  .auth-container { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .brand-text, .user-info-sm, .nav-item span, .nav-section-label { display: block; }
  .nav-item { justify-content: flex-start; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .tasks-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}
