:root {
  --color-bg-start: #E6F1FB;
  --color-bg-end: #B5D4F4;
  --color-primary: #185FA5;
  --color-primary-dark: #0C447C;
  --color-primary-light: #85B7EB;
  --color-text: #042C53;
  --color-error-bg: #FCEBEB;
  --color-error-text: #A32D2D;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 1px 3px rgba(12, 68, 124, 0.1);
  animation: fade-in 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 16px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: var(--color-primary-dark);
  margin: 0;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--color-primary);
  margin: 4px 0 0;
}

.login-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin: 20px 0 0;
}

label {
  display: block;
  font-size: 12px;
  color: var(--color-primary-dark);
  margin: 20px 0 6px;
}

.input-field {
  position: relative;
}

.input-field svg.field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary-light);
  pointer-events: none;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 68, 124, 0.25);
  background: rgba(255, 255, 255, 0.7);
  padding: 0 12px 0 38px;
  font-size: 14px;
  color: var(--color-text);
}

input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--color-primary);
  display: flex;
}

button[type="submit"] {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.15s ease;
}

button[type="submit"]:hover {
  background: var(--color-primary-dark);
}

button:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.login-forgot {
  text-align: center;
  margin: 14px 0 0;
  font-size: 13px;
}

.login-forgot a {
  color: var(--color-primary);
  text-decoration: none;
}

.login-forgot a:hover {
  text-decoration: underline;
}

.login-footer {
  border-top: 1px solid rgba(12, 68, 124, 0.15);
  margin-top: 20px;
  padding-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-info {
  background: rgba(24, 95, 165, 0.08);
  color: var(--color-primary-dark);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin: 20px 0 0;
}

.code-input {
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 68, 124, 0.25);
  background: rgba(255, 255, 255, 0.7);
  padding: 0 12px;
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.resend-form {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.resend-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.password-hint {
  font-size: 11.5px;
  color: var(--color-primary);
  line-height: 1.5;
  margin: -8px 0 4px;
}

.dashboard-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid rgba(12, 68, 124, 0.1);
}

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

.dashboard-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary-dark);
}

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

.dashboard-user-email {
  font-size: 13px;
  color: rgba(12, 68, 124, 0.6);
}

.btn-secondary {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 68, 124, 0.25);
  background: #fff;
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(24, 95, 165, 0.06);
}

.dashboard-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
}

.dashboard-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 4px;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--color-primary);
  margin: 0 0 32px;
}

.dashboard-card {
  background: #fff;
  border: 1px solid rgba(12, 68, 124, 0.1);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(24, 95, 165, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.dashboard-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 6px;
}

.dashboard-card-text {
  font-size: 13px;
  color: rgba(12, 68, 124, 0.6);
  margin: 0;
}

.badge-admin {
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary-dark);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.dashboard-tabs {
  display: flex;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid rgba(12, 68, 124, 0.1);
  overflow-x: auto;
}

.dashboard-tab {
  padding: 12px 4px;
  margin-right: 24px;
  font-size: 13.5px;
  color: rgba(12, 68, 124, 0.55);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.dashboard-tab:hover {
  color: var(--color-primary-dark);
}

.dashboard-tab-active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
}

.dashboard-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 12px;
}

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  height: 36px;
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 68, 124, 0.25);
  background: #fff;
  padding: 0 12px;
  font-size: 13px;
  line-height: 34px;
  color: var(--color-text);
}

.inline-form button {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 34px;
  cursor: pointer;
  white-space: nowrap;
}

.inline-form button:hover {
  background: var(--color-primary-dark);
}

.data-list {
  background: #fff;
  border: 1px solid rgba(12, 68, 124, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.data-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(12, 68, 124, 0.08);
}

.data-list-row:last-child {
  border-bottom: none;
}

.data-list-title {
  font-size: 13.5px;
  color: var(--color-text);
  margin: 0;
}

.data-list-meta {
  font-size: 11.5px;
  color: rgba(12, 68, 124, 0.5);
  margin: 2px 0 0;
}

.data-list-empty {
  padding: 24px 20px;
  font-size: 13px;
  color: rgba(12, 68, 124, 0.5);
  text-align: center;
}

.btn-delete {
  width: auto !important;
  height: auto !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 12.5px;
  font-weight: 400 !important;
  color: #B23434 !important;
  cursor: pointer;
  text-decoration: underline;
}

.btn-delete:hover {
  background: none !important;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: 12px;
}

.collapsible-header:hover .dashboard-section-title {
  color: var(--color-primary);
}

.collapsible-chevron {
  transition: transform 0.15s ease;
  color: rgba(12, 68, 124, 0.5);
  flex-shrink: 0;
}

.file-box {
  border: 1.5px dashed rgba(12, 68, 124, 0.3);
  border-radius: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
}

.file-box-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.file-box-tiles:not(:empty) {
  margin-bottom: 16px;
}

.file-tile {
  position: relative;
}

.file-tile-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E24B4A;
  border: 2px solid #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.file-tile-card {
  background: #fff;
  border: 1px solid rgba(12, 68, 124, 0.12);
  border-radius: var(--radius);
  padding: 12px 6px;
  text-align: center;
}

.file-tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.file-tile-name {
  font-size: 11.5px;
  color: var(--color-text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tile-size {
  font-size: 11px;
  color: rgba(12, 68, 124, 0.5);
  margin: 2px 0 0;
}

.file-box-import {
  text-align: center;
}

.file-box-import-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-box-import-btn:hover {
  background: var(--color-primary-dark);
}

.file-box-error {
  color: #A32D2D;
  font-size: 12.5px;
  margin: 10px 0 0;
  text-align: center;
}

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 44, 83, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.confirm-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
}

.confirm-modal-message {
  font-size: 14px;
  color: var(--color-text);
  margin: 0 0 20px;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-confirm-delete {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: none;
  background: #E24B4A;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-confirm-delete:hover {
  background: #A32D2D;
}

.search-input {
  width: 100%;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 68, 124, 0.25);
  background: #fff;
  padding: 0 12px 0 36px;
  font-size: 13px;
  color: var(--color-text);
  box-sizing: border-box;
}

.search-field {
  position: relative;
  margin-bottom: 16px;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(12, 68, 124, 0.4);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(12, 68, 124, 0.25);
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.settings-section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 8px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(12, 68, 124, 0.12);
}

.legal-page {
  min-height: 100vh;
  background: #F7FAFD;
}

.legal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid rgba(12, 68, 124, 0.1);
}

.legal-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  color: var(--color-text);
  line-height: 1.7;
}

.legal-content h1 {
  font-size: 22px;
  color: var(--color-primary-dark);
  margin: 0 0 8px;
}

.legal-content .legal-updated {
  font-size: 12.5px;
  color: rgba(12, 68, 124, 0.5);
  margin: 0 0 32px;
}

.legal-content h2 {
  font-size: 15px;
  color: var(--color-primary-dark);
  margin: 32px 0 10px;
}

.legal-content p, .legal-content li {
  font-size: 14px;
  color: var(--color-text);
}

.legal-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.legal-placeholder {
  background: #FCEBEB;
  color: #A32D2D;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.search-card {
  background: #fff;
  border: 1px solid rgba(12, 68, 124, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-card input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(12, 68, 124, 0.2);
  padding: 0 14px;
  font-size: 14px;
  color: var(--color-text);
  box-sizing: border-box;
}

.search-clear-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: var(--color-primary-dark);
}

.client-table-wrap {
  background: #fff;
  border: 1px solid rgba(12, 68, 124, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
}

.client-table thead th {
  background: var(--color-primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  padding: 14px 20px;
  white-space: nowrap;
}

.client-table tbody td {
  padding: 14px 20px;
  font-size: 13.5px;
  color: var(--color-text);
  border-bottom: 1px solid rgba(12, 68, 124, 0.08);
}

.client-table tbody tr:last-child td {
  border-bottom: none;
}

.client-table tbody tr[data-href] {
  cursor: pointer;
}

.client-table tbody tr[data-href]:hover td {
  background: rgba(24, 95, 165, 0.05);
}

.client-table .cell-muted {
  color: rgba(12, 68, 124, 0.5);
  font-size: 12.5px;
}

.preview-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 44, 83, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.preview-modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.preview-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(12, 68, 124, 0.6);
  padding: 4px;
  flex-shrink: 0;
}

.preview-modal-body {
  overflow: auto;
}

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

.info-grid-label {
  font-size: 11.5px;
  color: rgba(12, 68, 124, 0.55);
  margin: 0 0 3px;
}

.info-grid-value {
  font-size: 14px;
  color: var(--color-text);
  margin: 0;
}

.month-divider td {
  background: rgba(24, 95, 165, 0.06) !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-primary-dark);
  padding: 10px 20px !important;
  border-bottom: 1px solid rgba(12, 68, 124, 0.08) !important;
}

.month-divider .month-count {
  font-weight: 400;
  color: rgba(12, 68, 124, 0.5);
  margin-left: 8px;
}

.month-divider .month-download {
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-name-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.table-action-link {
  width: auto !important;
  height: auto !important;
  font-size: 12.5px;
  font-weight: 400 !important;
  color: var(--color-primary) !important;
  cursor: pointer;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-decoration: none;
  display: inline;
}

.table-action-link:hover {
  text-decoration: underline;
  background: none !important;
}

.preview-banner {
  background: #0C447C;
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
  text-align: center;
}

.preview-banner a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}

@media (max-width: 400px) {
  .login-card {
    padding: 32px 24px;
  }
}
