﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root,
:root[data-theme='clean'] {
  --bg-body: #eef3fc;
  --bg-spot-a: rgba(85, 138, 255, 0.18);
  --bg-spot-b: rgba(52, 211, 234, 0.16);

  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(169, 192, 236, 0.4);
  --glass-shadow: 0 16px 32px rgba(17, 43, 92, 0.12);

  --surface: rgba(255, 255, 255, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.56);
  --surface-border: rgba(142, 170, 224, 0.36);

  --text-main: #1a2a47;
  --text-soft: #53688d;
  --text-muted: #6e82a7;

  --primary: #2f6df6;
  --primary-strong: #2558c8;
  --primary-soft: rgba(47, 109, 246, 0.14);

  --sidebar-bg: rgba(8, 23, 54, 0.82);
  --sidebar-border: rgba(125, 166, 245, 0.2);
  --sidebar-link: #d8e5ff;
  --sidebar-muted: #93add7;
  --sidebar-hover: rgba(101, 150, 246, 0.2);

  --danger: #ef4d63;
  --success: #0f9a6c;

  --input-bg: rgba(255, 255, 255, 0.78);
  --input-border: rgba(130, 160, 216, 0.45);
  --table-border: rgba(127, 157, 214, 0.35);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

:root[data-theme='dark'] {
  --bg-body: #081126;
  --bg-spot-a: rgba(59, 130, 246, 0.26);
  --bg-spot-b: rgba(56, 189, 248, 0.18);

  --glass-bg: rgba(10, 22, 48, 0.6);
  --glass-strong: rgba(11, 25, 53, 0.78);
  --glass-border: rgba(79, 107, 161, 0.44);
  --glass-shadow: 0 18px 34px rgba(2, 8, 22, 0.45);

  --surface: rgba(11, 24, 52, 0.74);
  --surface-soft: rgba(12, 24, 49, 0.54);
  --surface-border: rgba(72, 96, 145, 0.46);

  --text-main: #e5efff;
  --text-soft: #b6c7e9;
  --text-muted: #8ba0ca;

  --primary: #64a3ff;
  --primary-strong: #3f82eb;
  --primary-soft: rgba(100, 163, 255, 0.2);

  --sidebar-bg: rgba(4, 13, 30, 0.88);
  --sidebar-border: rgba(70, 95, 143, 0.48);
  --sidebar-link: #dbe8ff;
  --sidebar-muted: #90a6ce;
  --sidebar-hover: rgba(98, 152, 251, 0.2);

  --danger: #ff7386;
  --success: #2bc78f;

  --input-bg: rgba(10, 21, 46, 0.76);
  --input-border: rgba(72, 95, 141, 0.6);
  --table-border: rgba(70, 94, 141, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-main);
  background: var(--bg-body);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 48vw;
  height: 48vw;
  top: -22vw;
  left: -14vw;
  background: radial-gradient(circle, var(--bg-spot-a) 0%, rgba(0, 0, 0, 0) 70%);
}

body::after {
  width: 44vw;
  height: 44vw;
  right: -12vw;
  bottom: -20vw;
  background: radial-gradient(circle, var(--bg-spot-b) 0%, rgba(0, 0, 0, 0) 70%);
}

.main {
  min-height: 100vh;
  margin-left: 0;
  padding: 0.95rem;
  transition: margin-left 0.24s ease, padding 0.24s ease;
}

.main > .container,
.main > .container-fluid {
  padding-left: 0;
  padding-right: 0;
}

h1,
.h1 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2,
.h2 {
  font-size: clamp(1.35rem, 1.7vw, 1.75rem);
  font-weight: 700;
}

h3,
.h3 {
  font-size: clamp(1.2rem, 1.45vw, 1.45rem);
  font-weight: 700;
}

h4,
.h4 {
  font-size: clamp(1.05rem, 1.2vw, 1.24rem);
  font-weight: 650;
}

h5,
.h5 {
  font-size: 1rem;
  font-weight: 600;
}

.text-muted {
  color: var(--text-muted) !important;
}

.topbar-shell {
  padding: 0.72rem 0.88rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sidebar {
  position: fixed;
  top: 0;
  left: -270px;
  width: 262px;
  height: 100vh;
  z-index: 1040;
  overflow-y: auto;
  padding-bottom: 1rem;
  border-right: 1px solid var(--sidebar-border);
  background: linear-gradient(165deg, var(--sidebar-bg), rgba(3, 12, 30, 0.95));
  box-shadow: 12px 0 34px rgba(3, 9, 23, 0.32);
  transition: left 0.24s ease;
}

.sidebar.show {
  left: 0;
  box-shadow: 12px 0 34px rgba(2, 8, 22, 0.5), 100vw 0 0 rgba(2, 10, 27, 0.52);
}

.sidebar .brand {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.9rem 1rem;
  color: #f2f7ff;
  font-size: 1.15rem;
  line-height: 1.15;
  font-weight: 800;
  border-bottom: 1px solid rgba(150, 182, 245, 0.18);
}

.sidebar .brand i {
  color: #44bdf8;
  font-size: 1.05rem;
}

.sidebar .user-info {
  margin: 0.8rem;
  padding: 0.84rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(141, 177, 244, 0.2);
  background: rgba(121, 166, 251, 0.12);
  color: #f5f9ff;
}

.sidebar .user-info small {
  color: var(--sidebar-muted) !important;
}

.sidebar .nav-heading {
  margin: 0.65rem 0 0.2rem;
  padding: 0.36rem 1rem;
  color: var(--sidebar-muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 800;
}

.sidebar .nav-link,
.sidebar .nav-link:link,
.sidebar .nav-link:visited {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  margin: 0.13rem 0.55rem;
  padding: 0.54rem 0.72rem;
  border-radius: 10px;
  color: var(--sidebar-link) !important;
  text-decoration: none !important;
  font-size: 0.98rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.sidebar .nav-link i {
  width: 19px;
  text-align: center;
  color: #9bc2ff;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  border-color: rgba(147, 189, 255, 0.2);
}

.sidebar .nav-link.active {
  color: #fff !important;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  border-color: rgba(188, 215, 255, 0.28);
  box-shadow: 0 8px 16px rgba(36, 90, 201, 0.3);
}

.sidebar .nav-link.active i {
  color: #fff;
}

.sidebar .nav-link.text-danger,
.sidebar .nav-link.text-danger i {
  color: var(--danger) !important;
}

.theme-toggle-btn {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.52rem 0.78rem;
  background: var(--surface-soft);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  transition: all 0.18s ease;
}

.theme-toggle-btn:hover {
  background: var(--primary-soft);
  border-color: rgba(120, 166, 255, 0.4);
}

.sidebar-theme-toggle {
  width: calc(100% - 1.1rem);
  margin: 0.24rem 0.55rem;
  justify-content: center;
  color: var(--sidebar-link);
  background: rgba(112, 152, 238, 0.16);
  border-color: rgba(139, 178, 251, 0.25);
}

.topbar-theme-toggle {
  margin-left: 0.8rem;
}

.desktop-toggle-btn {
  width: 40px;
  height: 40px;
  margin-right: 0.68rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  color: var(--text-soft);
}

.desktop-toggle-btn:hover {
  background: var(--primary-soft);
  color: var(--text-main);
}

.mobile-menu-btn {
  position: fixed;
  right: 0.95rem;
  bottom: 0.95rem;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 1.25rem;
  z-index: 1050;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 24px rgba(37, 88, 200, 0.36);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0.25rem 0 1rem;
}

.page-title {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.4rem, 1.95vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0.28rem 0 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.card,
.content-card,
.filter-wrapper,
.table-responsive,
.modal-content,
.alert,
.dropdown-menu,
.login-card-modern {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card,
.content-card,
.filter-wrapper,
.table-responsive,
.modal-content,
.alert {
  border-radius: var(--radius-md) !important;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer {
  background: transparent !important;
  border-color: var(--table-border) !important;
}

.filter-wrapper {
  padding: 0.9rem;
  margin-bottom: 0.95rem;
}

.form-label {
  margin-bottom: 0.26rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

.form-control,
.form-select,
textarea,
.input-group-text {
  min-height: 38px;
  border-radius: 10px !important;
  border: 1px solid var(--input-border) !important;
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
  font-size: 0.95rem;
}

.form-control-sm,
.form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
  min-height: 34px;
  font-size: 0.88rem;
}

.form-control::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(92, 146, 255, 0.66) !important;
  box-shadow: 0 0 0 0.16rem rgba(74, 130, 245, 0.2) !important;
}

.btn {
  min-height: 38px;
  border-radius: 10px !important;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.44rem 0.84rem;
}

.btn-sm {
  min-height: 32px;
  font-size: 0.84rem;
  padding: 0.3rem 0.58rem;
}

.btn-primary,
.btn-success {
  color: #fff;
  border: 0;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
}

.btn-light {
  color: var(--text-soft);
  border-color: var(--surface-border);
  background: var(--surface-soft);
}

.btn-outline-primary {
  color: var(--primary-strong);
  border-color: rgba(76, 128, 230, 0.38);
}

.btn-outline-primary:hover {
  background: rgba(71, 118, 219, 0.1);
}

.btn-outline-danger {
  color: var(--danger);
  border-color: rgba(236, 91, 112, 0.45);
}

.btn-group {
  gap: 0.32rem;
}

.btn-group > .btn {
  border-radius: 9px !important;
}

.table {
  margin-bottom: 0;
  color: var(--text-main);
}

.table > :not(caption) > * > * {
  background: transparent !important;
  border-color: var(--table-border) !important;
}

.table thead th {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.76rem 0.9rem;
}

.table tbody td {
  font-size: 0.95rem;
  padding: 0.74rem 0.9rem;
  vertical-align: middle;
}

.table-modern thead th {
  background: rgba(255, 255, 255, 0.16) !important;
}

.table-modern tbody tr:hover,
.table-hover tbody tr:hover {
  background: rgba(108, 152, 238, 0.08) !important;
}

.invoice-id {
  font-family: 'Courier New', monospace;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-soft);
}

.client-name {
  display: block;
  font-weight: 600;
  color: var(--text-main);
}

.badge {
  font-weight: 600;
  letter-spacing: 0;
}

.badge-status {
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-success {
  color: #0a7b53;
  background: rgba(17, 169, 117, 0.18);
}

.badge-neutral {
  color: var(--text-soft);
  background: rgba(142, 160, 190, 0.2);
}

.btn-icon {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  color: var(--text-soft);
  transition: all 0.16s ease;
}

.btn-icon:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.btn-icon.delete:hover {
  color: var(--danger);
  background: rgba(239, 77, 99, 0.13);
}

.nav-tabs {
  border-bottom-color: var(--table-border);
}

.nav-tabs .nav-link {
  color: var(--text-soft);
  border: 1px solid transparent;
  border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link.active {
  color: var(--text-main);
  background: var(--surface);
  border-color: var(--table-border);
  border-bottom-color: transparent;
}

.login-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card-modern {
  width: 100%;
  max-width: 408px !important;
  padding: 1.8rem 1.4rem;
  border-radius: var(--radius-lg);
}

.login-title {
  margin-bottom: 0.35rem;
  color: var(--text-main);
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.form-control-modern {
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
}

.form-control-modern:focus {
  border-color: rgba(92, 146, 255, 0.66);
  box-shadow: 0 0 0 0.16rem rgba(74, 130, 245, 0.2);
}

.btn-login-modern {
  border: 0;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 22px rgba(37, 88, 200, 0.34);
}

@media (max-width: 991px) {
  .main {
    padding: 0.8rem;
    margin-left: 0 !important;
  }

  .topbar-shell {
    padding: 0.58rem 0.72rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header > a.btn,
  .page-header > button.btn {
    width: 100%;
  }

  .filter-wrapper {
    padding: 0.74rem;
  }

  .table thead th,
  .table tbody td {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }
}

@media (min-width: 992px) {
  .sidebar {
    left: 0;
  }

  .main {
    margin-left: 262px;
    padding: 1.25rem 1.35rem;
  }

  .mobile-menu-btn {
    display: none !important;
  }
}

@media (min-width: 1400px) {
  .main {
    padding: 1.5rem 1.75rem;
  }

  .main > *:not(.mobile-menu-btn) {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 992px) {
  body.sidebar-mini .sidebar {
    width: 82px;
    overflow: hidden;
  }

  body.sidebar-mini .main {
    margin-left: 82px;
  }

  body.sidebar-mini .sidebar .user-info,
  body.sidebar-mini .sidebar .nav-heading,
  body.sidebar-mini .sidebar .sidebar-theme-toggle {
    display: none !important;
  }

  body.sidebar-mini .sidebar .brand {
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  body.sidebar-mini .sidebar .brand i {
    font-size: 1.4rem;
    margin: 0;
  }

  body.sidebar-mini .sidebar .nav-link {
    justify-content: center;
    font-size: 0;
    padding: 0.64rem 0;
  }

  body.sidebar-mini .sidebar .nav-link i {
    width: auto;
    margin: 0;
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
