:root {
  --blue-950: #061f3a;
  --blue-900: #09294b;
  --blue-800: #0e3a66;
  --blue-700: #155083;
  --gold-500: #d6a53a;
  --gold-400: #f0c96a;
  --gold-300: #f9db93;
  --ink-50: #f6f7fa;
  --ink-200: #cad5e5;
  --ink-900: #101f35;
  --danger: #ff6b6b;
  --success: #31c48d;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 12px 30px rgba(8, 33, 61, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-50);
  font-family: "Poppins", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 20%, rgba(248, 208, 108, 0.2) 0%, transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(25, 89, 146, 0.45) 0%, transparent 45%),
    linear-gradient(120deg, var(--blue-950), #04172c 52%, #12365f 100%);
}

.hidden {
  display: none !important;
}

.glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(240, 201, 106, 0.24);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px;
}

.logo-mark {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-950);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
}

.login-card h1 {
  margin: 12px 0 8px;
}

.login-card p {
  color: var(--ink-200);
  margin: 0 0 16px;
}

.login-card form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--gold-300);
}

input,
select,
textarea,
button {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(202, 213, 229, 0.25);
  border-radius: 10px;
  background: rgba(4, 24, 46, 0.65);
  color: var(--ink-50);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.seed-users {
  margin-top: 16px;
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-200);
}

.error-text {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--danger);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 20px;
  border-right: 1px solid rgba(240, 201, 106, 0.2);
  background: linear-gradient(180deg, rgba(6, 31, 58, 0.95), rgba(5, 22, 42, 0.98));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--blue-950);
  font-weight: 800;
  display: grid;
  place-items: center;
}

.brand h2 {
  margin: 0;
  font-size: 1.05rem;
}

.brand small {
  color: var(--ink-200);
}

.menu {
  display: grid;
  gap: 10px;
  align-content: start;
}

.menu-btn,
.submenu-btn,
.tab-btn,
.btn {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, filter 0.22s ease;
}

:is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button) {
  position: relative;
  will-change: transform;
}

:is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button):not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(6, 21, 39, 0.34);
}

:is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button):not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(6, 21, 39, 0.26);
}

:is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button):focus-visible {
  outline: 2px solid rgba(240, 201, 106, 0.88);
  outline-offset: 2px;
}

:is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button):disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(0.72);
}

.menu-btn,
.submenu-btn {
  text-align: left;
  color: var(--ink-50);
  background: rgba(21, 80, 131, 0.2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
}

.menu-btn:hover,
.submenu-btn:hover,
.menu-btn.active {
  border-color: rgba(240, 201, 106, 0.5);
  background: linear-gradient(135deg, rgba(214, 165, 58, 0.24), rgba(67, 126, 179, 0.36));
  color: #fff6da;
}

.submenu {
  display: grid;
  gap: 8px;
  margin-top: -2px;
  margin-left: 12px;
}

.side-footer {
  display: grid;
  gap: 10px;
}

.role-badge {
  background: rgba(214, 165, 58, 0.2);
  border: 1px solid rgba(240, 201, 106, 0.35);
  border-radius: 999px;
  padding: 7px 12px;
  text-transform: capitalize;
  text-align: center;
  color: var(--gold-300);
  font-size: 0.85rem;
}

.workspace {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--ink-200);
}

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

.btn {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--blue-950);
}

.btn-gold:hover {
  filter: brightness(1.08) saturate(1.08);
  box-shadow: 0 14px 24px rgba(214, 165, 58, 0.36), 0 0 0 1px rgba(240, 201, 106, 0.45) inset;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(240, 201, 106, 0.5);
  color: var(--gold-300);
}

.btn-outline:hover {
  background: linear-gradient(135deg, rgba(240, 201, 106, 0.18), rgba(67, 126, 179, 0.2));
  border-color: rgba(240, 201, 106, 0.75);
  color: #fff2cd;
}

.message {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(49, 196, 141, 0.2);
  border: 1px solid rgba(49, 196, 141, 0.5);
}

.page-section {
  display: none;
  animation: rise 0.25s ease;
}

.page-section.active {
  display: grid;
  gap: 16px;
}

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

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(21, 80, 131, 0.52), rgba(214, 165, 58, 0.18));
  border: 1px solid rgba(240, 201, 106, 0.3);
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.metric-card span {
  color: var(--ink-200);
  font-size: 0.85rem;
}

.metric-card strong {
  font-size: 1.25rem;
}

.clickable-card {
  cursor: pointer;
}

.card-hint {
  color: var(--gold-300);
  font-size: 0.72rem;
  opacity: 0.88;
}

.clickable-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 201, 106, 0.78);
  box-shadow: 0 14px 26px rgba(5, 18, 36, 0.42);
  background: linear-gradient(150deg, rgba(34, 114, 176, 0.5), rgba(240, 201, 106, 0.3));
}

.clickable-card:hover .card-hint {
  color: #fff3cf;
}

.clickable-card:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

.status-board {
  padding: 16px;
}

.status-board h4 {
  margin-top: 0;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 36, 66, 0.85);
  border: 1px solid rgba(240, 201, 106, 0.2);
  display: grid;
  gap: 4px;
  text-align: center;
}

.status-item label {
  color: var(--ink-200);
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.chart-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.chart-head h4 {
  margin: 0;
}

.chart-head p {
  margin: 4px 0 0;
  color: var(--ink-200);
  font-size: 0.82rem;
}

.bars-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 8px;
  align-items: center;
}

.bar-label {
  color: #d8e7f8;
  font-size: 0.78rem;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(202, 213, 229, 0.14);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  display: block;
  border-radius: 999px;
}

.bar-turnover {
  background: linear-gradient(90deg, #3f89db, #66a8f0);
}

.bar-expenses {
  background: linear-gradient(90deg, #df7b54, #eaa86d);
}

.bar-profit {
  background: linear-gradient(90deg, #25a978, #56cea3);
}

.bar-value {
  color: #f5f8ff;
  font-size: 0.78rem;
  font-weight: 600;
}

.donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.donut-chart {
  width: 114px;
  height: 114px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(#3a84d8 0% 100%);
}

.donut-chart::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #0d2e52;
  border: 1px solid rgba(202, 213, 229, 0.2);
}

.donut-chart span {
  position: relative;
  z-index: 1;
  color: #f2f8ff;
  font-size: 0.86rem;
  font-weight: 700;
}

.donut-legend {
  display: grid;
  gap: 6px;
}

.donut-legend div {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dbe9f8;
  font-size: 0.78rem;
}

.donut-legend strong {
  margin-left: auto;
  color: #fff3cf;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-hold {
  background: #d85c63;
}

.dot-progress {
  background: #3a84d8;
}

.dot-finished {
  background: #2cb27f;
}

.dot-received {
  background: #2cb27f;
}

.dot-unpaid {
  background: #d49a31;
}

.dashboard-details {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.dashboard-details-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dashboard-details-head h4 {
  margin: 0 0 6px;
}

.dashboard-details-head p {
  margin: 0;
  color: var(--ink-200);
}

.dashboard-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.detail-stat {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(240, 201, 106, 0.25);
  background: rgba(6, 31, 58, 0.5);
  display: grid;
  gap: 4px;
}

.detail-stat label {
  color: var(--ink-200);
  font-size: 0.76rem;
}

.detail-stat strong {
  font-size: 1rem;
  color: #fff4d1;
}

.form-card,
.table-card {
  padding: 16px;
}

.form-card h4,
.table-card h4 {
  margin: 0 0 12px;
}

.form-note {
  margin: -4px 0 10px;
  color: var(--ink-200);
  font-size: 0.85rem;
}

.form-hint {
  margin-top: 4px;
  color: #a9bfd8;
  font-size: 0.75rem;
  line-height: 1.35;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.logo-preview-card {
  border: 1px solid rgba(240, 201, 106, 0.28);
  border-radius: 12px;
  background: rgba(5, 26, 49, 0.5);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.company-logo-preview-wrap {
  min-height: 120px;
  border: 1px dashed rgba(240, 201, 106, 0.35);
  border-radius: 10px;
  background: rgba(4, 18, 37, 0.65);
  display: grid;
  place-items: center;
  padding: 10px;
}

#companyLogoPreview {
  max-width: 220px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-placeholder {
  margin: 0;
  color: #a9bfd8;
  font-size: 0.85rem;
}

.full-width {
  grid-column: 1 / -1;
}

.task-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.management-panel {
  display: none;
  gap: 16px;
}

.management-panel.active {
  display: grid;
}

.hr-panel {
  display: none;
  gap: 16px;
}

.hr-panel.active {
  display: grid;
}

.hr-leave-head {
  margin-bottom: 10px;
}

.leave-status-tabs {
  flex-wrap: wrap;
}

.role-notify-wrap {
  border: 1px solid rgba(240, 201, 106, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(5, 26, 49, 0.55);
  display: grid;
  gap: 9px;
}

.role-notify-wrap p {
  margin: 0;
  color: var(--ink-200);
  font-size: 0.84rem;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(240, 201, 106, 0.32);
  background: rgba(214, 165, 58, 0.12);
  color: var(--ink-50);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
}

.role-chip input {
  margin: 0;
  accent-color: var(--gold-500);
}

#managementTable td:nth-child(4),
#rolesTable td:nth-child(2),
#companiesTable td:nth-child(6),
#companiesTable td:nth-child(8) {
  white-space: normal;
  line-height: 1.4;
}

.tasks-section-head {
  align-items: center;
}

.tasks-view-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tasks-panel {
  display: none;
  gap: 16px;
}

.tasks-panel.active {
  display: grid;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tasks-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.task-column {
  border-radius: 14px;
  border: 1px solid rgba(202, 213, 229, 0.24);
  background: linear-gradient(145deg, rgba(12, 43, 76, 0.78), rgba(7, 28, 52, 0.9));
  overflow: hidden;
  min-height: 430px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.task-column-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(202, 213, 229, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-column-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.task-count {
  min-width: 32px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #1f548b;
  color: #e9f3ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.task-column-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 300px;
  transition: background 0.2s ease, outline-color 0.2s ease;
}

.task-column-body.drag-over {
  background: rgba(214, 165, 58, 0.1);
  outline: 1px dashed rgba(240, 201, 106, 0.62);
  outline-offset: -8px;
}

.task-empty {
  border: 1px dashed rgba(202, 213, 229, 0.32);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: #b6c9dd;
  font-size: 0.82rem;
  background: rgba(5, 22, 42, 0.5);
}

.task-card {
  border-radius: 12px;
  border: 1px solid rgba(202, 213, 229, 0.24);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(4, 18, 34, 0.24);
  cursor: grab;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.task-priority {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 7px;
  padding: 4px 8px;
}

.task-priority-low {
  background: rgba(16, 185, 129, 0.24);
  color: #ccf7e8;
}

.task-priority-medium {
  background: rgba(59, 130, 246, 0.24);
  color: #d4e7ff;
}

.task-priority-high {
  background: rgba(245, 158, 11, 0.24);
  color: #ffedc9;
}

.task-priority-urgent {
  background: rgba(239, 68, 68, 0.25);
  color: #ffd8d8;
}

.task-mini-status {
  color: #c9dbef;
  font-size: 0.72rem;
  font-weight: 600;
}

.task-card h5 {
  margin: 0;
  font-size: 1.03rem;
}

.task-card p {
  margin: 0;
  color: #c7d8ea;
  font-size: 0.86rem;
  min-height: 34px;
}

.task-dates {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #dbe9f8;
  font-size: 0.8rem;
}

.task-owner {
  color: #9cb7d4;
  font-size: 0.78rem;
}

.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.calendar-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.calendar-toolbar h4 {
  margin: 0;
}

.calendar-toolbar p {
  margin: 4px 0 0;
  color: var(--ink-200);
  font-size: 0.85rem;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-month-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff2c5;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 700px;
}

.calendar-weekdays span {
  font-size: 0.78rem;
  color: #aecded;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 700px;
}

.calendar-day {
  min-height: 120px;
  border: 1px solid rgba(202, 213, 229, 0.22);
  border-radius: 10px;
  padding: 8px;
  background: rgba(7, 31, 56, 0.72);
  display: grid;
  gap: 6px;
  align-content: start;
}

.calendar-day-out {
  opacity: 0.55;
}

.calendar-day-today {
  border-color: rgba(240, 201, 106, 0.8);
  box-shadow: 0 0 0 1px rgba(240, 201, 106, 0.28) inset;
}

.calendar-day-head {
  font-size: 0.85rem;
  font-weight: 700;
  color: #dfeeff;
}

.calendar-day-items {
  display: grid;
  gap: 4px;
}

.calendar-chip {
  font-size: 0.7rem;
  border-radius: 7px;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-chip-event {
  background: rgba(59, 130, 246, 0.28);
  color: #d9ebff;
}

.calendar-chip-task {
  background: rgba(214, 165, 58, 0.24);
  color: #ffeebf;
}

.calendar-more {
  color: #a8c2dc;
  font-size: 0.7rem;
}

.projects-hub {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.projects-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.projects-head-row h3 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.projects-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-200);
}

.projects-breadcrumb button {
  border: none;
  background: transparent;
  color: #95c1f0;
  cursor: pointer;
  padding: 0;
}

.projects-breadcrumb button:hover {
  color: #dcb968;
}

.projects-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(240, 201, 106, 0.25);
  background: rgba(21, 80, 131, 0.4);
  color: #d9ebff;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-icon:hover {
  background: linear-gradient(135deg, rgba(58, 118, 175, 0.68), rgba(214, 165, 58, 0.24));
  border-color: rgba(240, 201, 106, 0.72);
  color: #fff4d1;
}

.btn-icon.active {
  background: linear-gradient(135deg, #3a76af, #17497c);
  border-color: rgba(240, 201, 106, 0.55);
}

.project-status-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 6px;
  width: fit-content;
}

.status-tab {
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #dbe7f7;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.status-tab.active {
  background: #1e4f84;
  color: #ffffff;
}

.status-tab:hover:not(.active) {
  background: rgba(58, 118, 175, 0.44);
  color: #f2f8ff;
}

.projects-filter-row {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(202, 213, 229, 0.2);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.projects-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.projects-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 14px;
}

.project-card {
  border-radius: 16px;
  border: 1px solid rgba(202, 213, 229, 0.2);
  background: linear-gradient(145deg, rgba(11, 39, 70, 0.78), rgba(9, 32, 58, 0.9));
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(4, 18, 34, 0.28);
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-progress {
  background: rgba(59, 130, 246, 0.25);
  color: #c5e2ff;
}

.badge-finished {
  background: rgba(16, 185, 129, 0.2);
  color: #caf8e9;
}

.badge-hold {
  background: rgba(239, 68, 68, 0.2);
  color: #ffd2d2;
}

.project-avatar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58c28e, #3c8f6b);
  color: #d9f6ea;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 1px solid rgba(240, 201, 106, 0.35);
}

.project-title-wrap h4 {
  margin: 0;
  font-size: 1.45rem;
}

.project-title-wrap p {
  margin: 2px 0 0;
  color: var(--ink-200);
}

.project-meta {
  color: #b9c9db;
  min-height: 20px;
}

.project-due {
  color: #d9e6f5;
  font-weight: 600;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-stat {
  background: rgba(5, 23, 44, 0.55);
  border: 1px solid rgba(202, 213, 229, 0.18);
  border-radius: 10px;
  padding: 7px 8px;
  display: grid;
  gap: 2px;
}

.project-stat label {
  color: #9fb4cc;
  font-size: 0.7rem;
}

.project-stat strong {
  color: #f4f8ff;
  font-size: 0.83rem;
}

.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-add-card {
  border: 1px dashed rgba(202, 213, 229, 0.4);
  border-radius: 16px;
  background: rgba(9, 34, 62, 0.5);
  color: #e2efff;
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
}

.project-add-card strong {
  font-size: 1.35rem;
}

.project-empty {
  border: 1px dashed rgba(202, 213, 229, 0.35);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: #c4d6ea;
  background: rgba(7, 25, 46, 0.5);
}

.project-editor-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.project-editor-head {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-editor-head h1 {
  margin: 0;
}

.project-editor-head p {
  margin: 4px 0 0;
  color: var(--ink-200);
}

.project-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(11, 40, 72, 0.62);
  border: 1px solid rgba(240, 201, 106, 0.24);
}

.invoice-total-row {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(240, 201, 106, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(6, 31, 58, 0.55);
}

.invoice-total-row span {
  color: var(--ink-200);
}

.invoice-total-row strong {
  color: #fff3cf;
  font-size: 1.12rem;
}

.project-form-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-scope-card {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.project-scope-card h5 {
  margin: 0 0 10px;
}

.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.payments-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.payment-input {
  display: grid;
  gap: 5px;
}

.payment-input label {
  font-size: 0.78rem;
  color: var(--ink-200);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid rgba(202, 213, 229, 0.14);
  padding: 9px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--gold-300);
  font-size: 0.83rem;
  font-weight: 600;
}

td {
  color: var(--ink-50);
  font-size: 0.86rem;
}

.action-btn {
  border: 1px solid rgba(240, 201, 106, 0.4);
  background: rgba(214, 165, 58, 0.14);
  color: var(--gold-300);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.76rem;
  margin-right: 6px;
}

.action-btn:hover {
  border-color: rgba(240, 201, 106, 0.72);
  background: linear-gradient(135deg, rgba(214, 165, 58, 0.3), rgba(21, 80, 131, 0.36));
  color: #fff2cb;
}

.finance-panel {
  display: none;
  gap: 16px;
}

.finance-panel.active {
  display: grid;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: rgba(8, 33, 61, 0.65);
  color: var(--ink-200);
  border: 1px solid rgba(240, 201, 106, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
}

.tab-btn.active {
  color: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
}

.tab-btn:hover:not(.active) {
  border-color: rgba(240, 201, 106, 0.72);
  background: linear-gradient(135deg, rgba(22, 77, 128, 0.72), rgba(214, 165, 58, 0.25));
  color: #f4f9ff;
}

.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.owner-popup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.owner-popup.hidden {
  display: none;
}

.owner-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 48, 0.65);
}

.owner-popup-card {
  position: relative;
  width: min(1280px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 18px;
}

.owner-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.owner-popup-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.2fr);
  gap: 14px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-rows: auto;
    grid-template-columns: 1fr;
  }

  .menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .submenu {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dual-grid {
    grid-template-columns: 1fr;
  }

  .payments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-head-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-editor-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-filter-actions {
    grid-column: 1 / -1;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tasks-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }

  .owner-popup-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  :is(.btn, .menu-btn, .submenu-btn, .tab-btn, .btn-icon, .action-btn, .status-tab, .projects-breadcrumb button):hover {
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  .workspace {
    padding: 14px;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-filter-row {
    grid-template-columns: 1fr;
  }

  .projects-board {
    grid-template-columns: 1fr;
  }

  .project-stats {
    grid-template-columns: 1fr;
  }

  .tasks-board {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }
}
