/**
 * Toss Design System — 인트라넷 전역 스타일
 * @see https://tossmini-docs.toss.im/tds-mobile/foundation/colors/
 */

/* ============================================
   Base & typography
   ============================================ */

html.tds-theme,
body.tds-theme {
  color-scheme: light;
}

body.tds-theme {
  font-family: var(--font-family);
  font-size: var(--tds-typo5-size, 1.0625rem);
  line-height: var(--tds-typo5-line, 1.59375rem);
  color: var(--tds-text-primary);
  background-color: var(--tds-bg-page);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

body.tds-theme a {
  color: var(--tds-text-accent);
}

body.tds-theme a:hover {
  color: var(--tds-blue600);
}

/* ============================================
   App shell & layout
   ============================================ */

body.tds-theme .app-main {
  background-color: var(--tds-bg-page);
  /* layout.css padding 대체 — safe-area만 추가 */
  padding: var(--spacing-xl);
  padding-top: calc(var(--spacing-xl) + var(--tds-safe-top));
  padding-bottom: calc(var(--spacing-xl) + var(--tds-safe-bottom));
}

body.tds-theme .page-content {
  background: var(--tds-bg-surface);
  border: none;
  box-shadow: none;
  border-radius: var(--tds-surface-radius, var(--tds-radius-xl));
  padding: var(--spacing-xl);
}

/* page-content 없이 app-main 직속 콘텐츠 */
body.tds-theme .app-main > .page-header-with-actions,
body.tds-theme .app-main > .page-header,
body.tds-theme .app-main > .dashboard-card,
body.tds-theme .app-main > .dashboard-shell {
  max-width: 100%;
}

body.tds-theme .page-title {
  font-size: var(--tds-typo2-size);
  line-height: var(--tds-typo2-line);
  font-weight: 700;
  color: var(--tds-text-primary);
  letter-spacing: -0.02em;
}

body.tds-theme .page-description {
  font-size: var(--tds-typo6-size);
  line-height: var(--tds-typo6-line);
  color: var(--tds-text-secondary);
}

body.tds-theme .page-header-with-actions {
  margin-bottom: var(--tds-space-xl);
}

/* TDS 대시보드 — 패딩은 app-main 한 곳에서만, shell은 콘텐츠 래퍼 */
body.tds-theme .app-main--dashboard {
  padding: var(--spacing-xl);
  padding-top: calc(var(--tds-space-md) + var(--tds-safe-top));
  padding-bottom: calc(var(--tds-space-md) + var(--tds-safe-bottom));
}

@media (min-width: 1024px) {
  body.tds-theme .app-main--dashboard {
    padding: var(--spacing-xl);
    padding-top: calc(var(--tds-space-xl) + var(--tds-safe-top));
    padding-bottom: calc(var(--tds-space-xl) + var(--tds-safe-bottom));
  }
}

body.tds-theme .app-main--dashboard .page-header-with-actions {
  margin-bottom: var(--tds-space-lg);
}

body.tds-theme .app-main--dashboard .dashboard-shell--tds {
  padding: 0;
  background: transparent;
  min-height: auto;
}

body.tds-theme .page-header-with-actions--toolbar-only {
  align-items: flex-start;
}

body.tds-theme .page-header-with-actions--toolbar-only .page-header-left {
  display: flex;
  align-items: flex-start;
  gap: var(--tds-space-sm);
}

body.tds-theme .page-header-with-actions--toolbar-only .page-header-text {
  min-width: 0;
  flex: 1;
}

@media (max-width: 768px) {
  body.tds-theme .app-main {
    margin-left: 0;
    padding: 0.5rem;
    padding-top: calc(0.5rem + var(--tds-safe-top));
    padding-bottom: calc(0.5rem + var(--tds-safe-bottom));
  }

  body.tds-theme .page-content {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }

  body.tds-theme .app-main--dashboard {
    padding: 0.5rem;
    padding-top: calc(0.5rem + var(--tds-safe-top));
    padding-bottom: calc(0.5rem + var(--tds-safe-bottom));
  }

  body.tds-theme .app-main--dashboard .page-header-with-actions {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--tds-space-md);
  }

  body.tds-theme .page-header-with-actions--toolbar-only .page-header-left {
    align-items: center;
  }

  body.tds-theme .page-header-with-actions--toolbar-only .page-description {
    display: none;
  }
}

/* ============================================
   Sidebar
   ============================================ */

body.tds-theme .sidebar {
  background-color: var(--tds-bg-surface);
  border-right: 1px solid var(--tds-border-default);
  box-shadow: none;
}

body.tds-theme .sidebar-logo-section,
body.tds-theme .sidebar-user-info,
body.tds-theme .sidebar-footer {
  background-color: var(--tds-bg-surface);
  border-color: var(--tds-border-default);
}

body.tds-theme .menu-section-title {
  font-size: var(--tds-typo7-size);
  color: var(--tds-text-tertiary);
  letter-spacing: 0.04em;
}

body.tds-theme .menu-item {
  border-radius: var(--tds-radius-md);
  color: var(--tds-text-primary);
  font-size: var(--tds-typo6-size);
}

body.tds-theme .menu-item:hover {
  background-color: var(--tds-grey100);
}

body.tds-theme .menu-item.active {
  background-color: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .menu-item.active .menu-icon {
  color: var(--tds-blue500);
}

body.tds-theme .sidebar-role-badge-staff,
body.tds-theme .sidebar-user-badge-security {
  color: var(--tds-blue600);
  background-color: var(--tds-blue50);
}

body.tds-theme .sidebar-role-badge-admin {
  color: var(--tds-purple500);
  background-color: var(--tds-purple50);
}

/* ============================================
   Buttons
   ============================================ */

body.tds-theme .btn {
  border-radius: var(--tds-radius-md);
  font-size: var(--tds-typo6-size);
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

body.tds-theme .btn-primary {
  background-color: var(--tds-blue500);
  color: #fff;
  box-shadow: none;
}

body.tds-theme .btn-primary:hover {
  background-color: var(--tds-blue600);
  box-shadow: none;
}

body.tds-theme a.btn.btn-primary,
body.tds-theme a.btn.btn-primary:hover,
body.tds-theme a.btn.btn-primary:focus,
body.tds-theme a.btn.btn-primary:visited {
  color: #fff;
}

body.tds-theme a.btn.btn-secondary,
body.tds-theme a.btn.btn-secondary:hover,
body.tds-theme a.btn.btn-secondary:focus,
body.tds-theme a.btn.btn-secondary:visited {
  color: var(--tds-text-primary);
}

body.tds-theme .btn-secondary {
  background-color: var(--tds-bg-surface);
  border: 1px solid var(--tds-border-default);
  color: var(--tds-text-primary);
  box-shadow: none;
}

body.tds-theme .btn-secondary:hover {
  background-color: var(--tds-grey100);
  border-color: var(--tds-grey300);
}

body.tds-theme .btn-success {
  background-color: var(--tds-green500);
  border-color: var(--tds-green600);
}

body.tds-theme .btn-success:hover {
  background-color: var(--tds-green600);
}

body.tds-theme .btn-error {
  background-color: var(--tds-red500);
  border-color: var(--tds-red600);
}

body.tds-theme .btn-error:hover {
  background-color: var(--tds-red600);
}

body.tds-theme .btn-outline {
  color: var(--tds-blue500);
  border-color: var(--tds-blue500);
}

body.tds-theme .btn-outline:hover {
  background-color: var(--tds-blue500);
  color: #fff;
}

body.tds-theme .btn-ghost {
  background-color: var(--tds-grey100);
  border-color: var(--tds-border-default);
  color: var(--tds-text-primary);
}

body.tds-theme .btn-ghost:hover {
  background-color: var(--tds-grey200);
}

body.tds-theme .btn-icon {
  border-radius: var(--tds-radius-md);
  border-color: var(--tds-border-default);
  background: var(--tds-bg-surface);
}

body.tds-theme .btn-icon:hover {
  background: var(--tds-grey100);
}

body.tds-theme .notification-badge {
  background-color: var(--tds-red500);
}

/* ============================================
   Forms
   ============================================ */

body.tds-theme .form-label {
  font-size: var(--tds-typo6-size);
  font-weight: 600;
  color: var(--tds-text-primary);
}

body.tds-theme .form-control {
  border: 1px solid var(--tds-border-default);
  border-radius: var(--tds-radius-md);
  background-color: var(--tds-bg-surface);
  color: var(--tds-text-primary);
  font-size: var(--tds-typo5-size);
  padding: 0.75rem 1rem;
}

body.tds-theme .form-control:hover {
  border-color: var(--tds-grey300);
}

body.tds-theme .form-control:focus {
  border-color: var(--tds-blue500);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

body.tds-theme .form-text {
  font-size: var(--tds-typo7-size);
  color: var(--tds-text-secondary);
}

/* ============================================
   Cards
   ============================================ */

body.tds-theme .card {
  background-color: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .card-header {
  border-bottom: 1px solid var(--tds-border-light);
}

body.tds-theme .card-title {
  font-size: var(--tds-typo3-size);
  line-height: var(--tds-typo3-line);
  font-weight: 600;
  color: var(--tds-text-primary);
}

body.tds-theme .card-footer {
  border-top: 1px solid var(--tds-border-light);
}

body.tds-theme .dashboard-card,
body.tds-theme .kpi-card {
  background: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .dashboard-card {
  margin-bottom: var(--tds-space-lg);
}

body.tds-theme .dashboard-shell--tds .dashboard-card,
body.tds-theme .dashboard-shell--tds .dashboard-main-grid .dashboard-card {
  padding: 0;
  margin-bottom: 0;
}

body.tds-theme .dashboard-main-grid > .dashboard-card-row-thirds,
body.tds-theme .dashboard-main-grid > .tds-section {
  margin-bottom: 0;
}

body.tds-theme .dashboard-card:last-child {
  margin-bottom: 0;
}

body.tds-theme .dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tds-space-md);
  padding-bottom: var(--tds-space-md);
  margin-bottom: var(--tds-space-md);
  border-bottom: 1px solid var(--tds-border-light);
}

body.tds-theme .dashboard-shell--tds .dashboard-card-header {
  padding: var(--tds-space-lg) var(--tds-space-lg) var(--tds-space-sm);
  margin-bottom: 0;
  border-bottom: none;
}

body.tds-theme .dashboard-card-title {
  font-size: var(--tds-typo4-size);
  line-height: var(--tds-typo4-line);
  font-weight: 600;
  color: var(--tds-text-primary);
  margin: 0;
}

body.tds-theme .dashboard-card-link {
  font-size: var(--tds-typo7-size);
  font-weight: 500;
  color: var(--tds-blue500);
  text-decoration: none;
}

body.tds-theme .dashboard-card-link:hover {
  color: var(--tds-blue600);
}

body.tds-theme .dashboard-card-body {
  flex: 1;
  min-width: 0;
}

body.tds-theme .dashboard-quick-stat-card {
  background: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .dashboard-quick-stat-card:hover {
  transform: none;
  box-shadow: none;
}

body.tds-theme .dashboard-list-item {
  border-radius: var(--tds-radius-md);
}

body.tds-theme .dashboard-list-item:hover {
  background: var(--tds-grey50);
  transform: none;
}

body.tds-theme .dashboard-upcoming-schedules {
  background: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .dashboard-upcoming-item {
  background: var(--tds-grey50);
  border: none;
  border-radius: var(--tds-radius-md);
}

body.tds-theme .dashboard-upcoming-item:hover {
  background: var(--tds-grey100);
  transform: none;
}

/* saas-components KPI */
body.tds-theme .kpi-card-value {
  color: var(--tds-text-primary);
  letter-spacing: -0.02em;
}

body.tds-theme .kpi-card-label {
  color: var(--tds-text-secondary);
}

/* ============================================
   Tables
   ============================================ */

body.tds-theme .table {
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  width: 100%;
}

body.tds-theme .table-wrapper,
body.tds-theme .dashboard-card-body > div[style*="overflow-x"] {
  border-radius: var(--tds-radius-md);
}

body.tds-theme .table th {
  font-size: var(--tds-typo7-size);
  font-weight: 600;
  color: var(--tds-text-secondary);
  border-bottom: 1px solid var(--tds-border-default);
  padding: 0.75rem 1rem;
  text-transform: none;
  letter-spacing: normal;
}

body.tds-theme .table thead {
  background: var(--tds-grey50);
}

body.tds-theme .table td {
  font-size: var(--tds-typo6-size);
  color: var(--tds-text-primary);
  border-bottom: 1px solid var(--tds-border-light);
  padding: 0.875rem 1rem;
}

body.tds-theme .table tbody tr:hover {
  background-color: var(--tds-grey50);
}

body.tds-theme .table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Badges
   ============================================ */

body.tds-theme .badge {
  border-radius: var(--tds-radius-sm);
  font-size: var(--tds-typo7-size);
  font-weight: 600;
  padding: 0.125rem 0.5rem;
}

body.tds-theme .badge-primary {
  background-color: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .badge-success {
  background-color: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .badge-warning {
  background-color: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .badge-error {
  background-color: var(--tds-red50);
  color: var(--tds-red600);
}

body.tds-theme .badge-info {
  background-color: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .badge-secondary,
body.tds-theme .badge-outline {
  background-color: var(--tds-grey100);
  color: var(--tds-grey700);
  border-color: var(--tds-border-default);
}

body.tds-theme .dashboard-badge-primary,
body.tds-theme .dashboard-badge-secondary {
  background: var(--tds-grey100);
  color: var(--tds-grey700);
}

body.tds-theme .dashboard-badge-success {
  background: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .dashboard-badge-warning {
  background: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .dashboard-badge-error {
  background: var(--tds-red50);
  color: var(--tds-red600);
}

/* ============================================
   Modals
   ============================================ */

body.tds-theme .modal-overlay {
  background-color: rgba(2, 9, 19, 0.4);
  backdrop-filter: blur(2px);
}

body.tds-theme .modal {
  background-color: rgba(2, 9, 19, 0.4);
  backdrop-filter: blur(2px);
}

body.tds-theme .modal-overlay .modal,
body.tds-theme .modal .modal-content,
body.tds-theme .modal-content {
  background: var(--tds-bg-surface);
  border-radius: var(--tds-surface-radius, var(--tds-radius-xl));
  box-shadow: var(--tds-shadow-elevated, 0 16px 48px rgba(2, 9, 19, 0.12));
  border: none;
}

body.tds-theme .modal-header {
  border-bottom: 1px solid var(--tds-border-light);
}

body.tds-theme .modal-title {
  font-size: var(--tds-typo4-size);
  font-weight: 600;
  color: var(--tds-text-primary);
}

body.tds-theme .modal-footer {
  border-top: 1px solid var(--tds-border-light);
}

/* ============================================
   Tabs — TDS underline (tabs.css 호환)
   ============================================ */

body.tds-theme .tabs {
  display: flex;
  background: var(--tds-bg-surface);
  border-bottom: 1px solid var(--tds-border-default);
  border-radius: 0;
  padding: 0 var(--tds-space-xl);
  gap: 0.25rem;
  overflow-x: auto;
}

body.tds-theme .tab {
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: var(--tds-typo6-size);
  font-weight: 500;
  color: var(--tds-text-secondary);
  padding: 0.875rem 1.25rem;
  white-space: nowrap;
  cursor: pointer;
}

body.tds-theme .tab:hover {
  color: var(--tds-blue500);
  background: var(--tds-blue50);
}

body.tds-theme .tab.active {
  background: transparent;
  color: var(--tds-blue500);
  font-weight: 600;
  border-bottom-color: var(--tds-blue500);
  box-shadow: none;
}

body.tds-theme .tab-content {
  padding-top: var(--tds-space-lg);
}

/* tab-button / 업로드 탭 (profile, tasks, materials) */
body.tds-theme .tab-button,
body.tds-theme .progress-upload-tab-button,
body.tds-theme .upload-tab-button,
body.tds-theme .pm-tab {
  padding: 0.75rem 1.25rem !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  color: var(--tds-text-secondary) !important;
  font-size: var(--tds-typo6-size) !important;
  font-weight: 500 !important;
  cursor: pointer;
}

body.tds-theme .tab-button:hover,
body.tds-theme .progress-upload-tab-button:hover,
body.tds-theme .upload-tab-button:hover,
body.tds-theme .pm-tab:hover {
  color: var(--tds-blue500) !important;
  background: var(--tds-blue50) !important;
}

body.tds-theme .tab-button.active,
body.tds-theme .progress-upload-tab-button.active,
body.tds-theme .upload-tab-button.active,
body.tds-theme .pm-tab.active {
  color: var(--tds-blue500) !important;
  font-weight: 600 !important;
  border-bottom-color: var(--tds-blue500) !important;
  background: transparent !important;
}

body.tds-theme .customer-resources-tabs {
  border-bottom: 1px solid var(--tds-border-default);
  gap: 0.25rem;
}

/* ============================================
   Alerts & misc
   ============================================ */

body.tds-theme .alert {
  border-radius: var(--tds-radius-md);
  border: none;
}

body.tds-theme .alert-info {
  background: var(--tds-blue50);
  color: var(--tds-blue700);
}

body.tds-theme .alert-success {
  background: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .alert-warning {
  background: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .alert-error {
  background: var(--tds-red50);
  color: var(--tds-red600);
}

body.tds-theme .notification-sidebar {
  border-left-color: var(--tds-border-default);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
}

body.tds-theme .notification-sidebar-title {
  font-size: var(--tds-typo4-size);
  font-weight: 600;
}

/* Pagination */
body.tds-theme .pagination .page-link,
body.tds-theme .pagination a:not(.btn-primary) {
  border-radius: var(--tds-radius-sm);
  border-color: var(--tds-border-default);
  color: var(--tds-text-primary);
}

body.tds-theme .pagination .active .page-link,
body.tds-theme .pagination a.active,
body.tds-theme .pagination a.btn-primary {
  background: var(--tds-blue500);
  border-color: var(--tds-blue500);
  color: #fff;
}

body.tds-theme .pagination a.btn-primary:hover {
  background: var(--tds-blue600);
  border-color: var(--tds-blue600);
  color: #fff;
}

/* Search / filter bars */
body.tds-theme .filter-bar,
body.tds-theme .search-bar {
  background: var(--tds-bg-surface);
  border-radius: var(--tds-radius-lg);
  border: none;
}

/* ============================================
   Login page
   ============================================ */

body.tds-theme .login-container {
  background: var(--tds-bg-page) !important;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(2rem + var(--tds-safe-top)) calc(2rem + var(--tds-safe-right)) calc(2rem + var(--tds-safe-bottom)) calc(2rem + var(--tds-safe-left));
}

body.tds-theme .login-container::before {
  display: none;
}

body.tds-theme .login-box {
  background: var(--tds-bg-surface) !important;
  border: none !important;
  border-radius: var(--tds-surface-radius, var(--tds-radius-xl)) !important;
  box-shadow: none !important;
  padding: 2.5rem;
}

body.tds-theme .login-logo h1 {
  background: none;
  -webkit-text-fill-color: var(--tds-text-primary);
  color: var(--tds-text-primary);
  font-size: var(--tds-typo1-size);
  font-weight: 700;
}

body.tds-theme .login-logo p {
  color: var(--tds-text-secondary) !important;
}

body.tds-theme .register-container {
  background: var(--tds-bg-page) !important;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(2rem + var(--tds-safe-top)) calc(2rem + var(--tds-safe-right)) calc(2rem + var(--tds-safe-bottom)) calc(2rem + var(--tds-safe-left));
}

body.tds-theme .register-container::before {
  display: none;
}

body.tds-theme .register-box {
  background: var(--tds-bg-surface) !important;
  border: none !important;
  border-radius: var(--tds-surface-radius, var(--tds-radius-xl)) !important;
  box-shadow: none !important;
}

body.tds-theme .register-logo p {
  color: var(--tds-text-secondary) !important;
}

/* ============================================
   Header
   ============================================ */

body.tds-theme .header {
  background-color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--tds-border-default);
  box-shadow: none;
}

body.tds-theme .header-search input {
  border-radius: var(--tds-radius-md);
  border-color: var(--tds-border-default);
  background-color: var(--tds-grey100);
}

body.tds-theme .header-search input:focus {
  border-color: var(--tds-blue500);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

body.tds-theme .header-logo {
  color: var(--tds-blue500);
}

/* ============================================
   saas-components overrides
   ============================================ */

body.tds-theme .kpi-card {
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .kpi-card:hover {
  box-shadow: none;
  transform: none;
}

body.tds-theme .kpi-card-icon-blue {
  background-color: var(--tds-blue50);
  color: var(--tds-blue500);
}

body.tds-theme .kpi-card-icon-teal {
  background-color: var(--tds-teal50);
  color: var(--tds-teal500);
}

body.tds-theme .kpi-card-icon-purple {
  background-color: var(--tds-purple50);
  color: var(--tds-purple500);
}

body.tds-theme .kpi-card-icon-orange {
  background-color: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .data-table thead {
  background: var(--tds-grey50);
}

body.tds-theme .data-table th {
  color: var(--tds-text-secondary);
  border-bottom-color: var(--tds-border-default);
}

body.tds-theme .data-table td {
  border-bottom-color: var(--tds-border-light);
}

body.tds-theme .data-table tbody tr:hover {
  background-color: var(--tds-grey50);
}

body.tds-theme .status-badge-success,
body.tds-theme .status-pill-success {
  background: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .status-badge-warning,
body.tds-theme .status-pill-warning {
  background: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .status-badge-error,
body.tds-theme .status-pill-error {
  background: var(--tds-red50);
  color: var(--tds-red600);
}

body.tds-theme .status-badge-neutral,
body.tds-theme .status-pill-neutral {
  background: var(--tds-grey100);
  color: var(--tds-grey700);
}

body.tds-theme .status-badge-info,
body.tds-theme .status-pill-info {
  background: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .text-success { color: var(--tds-green500); }
body.tds-theme .text-warning { color: var(--tds-orange500); }
body.tds-theme .text-error { color: var(--tds-red500); }

body.tds-theme .page-actions .filter-form > input,
body.tds-theme .page-actions .filter-form > select {
  border-radius: var(--tds-radius-md);
  border-color: var(--tds-border-default);
}

body.tds-theme .empty-state-icon {
  color: var(--tds-grey300);
}

/* ============================================
   Stats cards (settlements, accounting)
   ============================================ */

body.tds-theme .stats-card {
  background: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
  padding: var(--tds-space-xl);
}

body.tds-theme .stats-card:hover {
  transform: none;
  box-shadow: none;
}

body.tds-theme .stats-card-value {
  color: var(--tds-text-primary);
  letter-spacing: -0.02em;
}

body.tds-theme .stats-card-label {
  color: var(--tds-text-secondary);
}

/* ============================================
   Status badges (dynamic + main.css variants)
   ============================================ */

body.tds-theme .status-badge {
  border-radius: var(--tds-radius-sm);
  font-size: var(--tds-typo7-size);
  font-weight: 600;
}

body.tds-theme .status-badge.progress {
  background: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .status-badge.review {
  background: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .status-badge.completed {
  background: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .status-badge.waiting {
  background: var(--tds-grey100);
  color: var(--tds-grey700);
}

body.tds-theme .status-received {
  background: var(--tds-orange50);
  color: var(--tds-orange500);
}

body.tds-theme .status-in_progress {
  background: var(--tds-blue50);
  color: var(--tds-blue600);
}

body.tds-theme .status-completed {
  background: var(--tds-green50);
  color: var(--tds-green600);
}

body.tds-theme .status-cancelled {
  background: var(--tds-red50);
  color: var(--tds-red600);
}

/* ============================================
   Progress page (client/progress.php)
   ============================================ */

body.tds-theme .progress-stage-card {
  background: var(--tds-bg-surface);
  border: 1px solid var(--tds-border-light);
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .progress-stage-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--tds-border-default);
}

body.tds-theme .project-summary-kpis .kpi-card {
  background: var(--tds-bg-surface);
  border: 1px solid var(--tds-border-light);
  border-radius: var(--tds-radius-md);
}

body.tds-theme .project-summary-kpis .kpi-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--tds-blue200);
  background: var(--tds-bg-surface);
}

body.tds-theme .progress-page-header {
  background: var(--tds-bg-surface);
  border: none;
  border-radius: var(--tds-radius-xl);
  box-shadow: none;
  padding: var(--tds-space-md) var(--tds-space-lg);
  margin-bottom: var(--tds-space-md);
}

/* ============================================
   Vault cards
   ============================================ */

body.tds-theme .vault-card {
  background: var(--tds-bg-surface);
  border: 1px solid var(--tds-border-light);
  border-radius: var(--tds-radius-lg);
  box-shadow: none;
}

body.tds-theme .vault-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--tds-border-default);
}

body.tds-theme .vault-card:hover .vault-logo {
  transform: none;
}

/* ============================================
   Page actions & filters
   ============================================ */

body.tds-theme .page-actions {
  gap: var(--tds-space-md);
  margin-bottom: var(--tds-space-lg);
}

body.tds-theme .page-actions .form-control,
body.tds-theme .page-actions form .form-control,
body.tds-theme .page-actions form select,
body.tds-theme .page-actions form input[type="text"],
body.tds-theme .page-actions form input[type="search"],
body.tds-theme .page-actions form input[type="date"],
body.tds-theme .page-actions form input[type="month"],
body.tds-theme .page-actions .filter-form > input,
body.tds-theme .page-actions .filter-form > select {
  border-radius: var(--tds-radius-md);
  border-color: var(--tds-border-default);
  background: var(--tds-bg-surface);
}

body.tds-theme .dashboard-card-body form[style*="background"],
body.tds-theme .dashboard-card-body > div[style*="background: #f9fafb"],
body.tds-theme .dashboard-card-body > div[style*="background:#f9fafb"] {
  background: var(--tds-grey50) !important;
  border-radius: var(--tds-radius-md) !important;
}

/* ============================================
   Breadcrumb & misc layout
   ============================================ */

body.tds-theme .breadcrumb {
  font-size: var(--tds-typo7-size);
  color: var(--tds-text-secondary);
}

body.tds-theme .breadcrumb-link:hover {
  color: var(--tds-blue500);
}

body.tds-theme .breadcrumb-current {
  color: var(--tds-text-primary);
}

body.tds-theme .mobile-menu-toggle {
  border-color: var(--tds-border-default);
  background: var(--tds-bg-surface);
  border-radius: var(--tds-radius-md);
}

body.tds-theme .mobile-menu-toggle:hover {
  background: var(--tds-grey100);
}

/* ============================================
   Client dashboard — TDS surface 통일
   ============================================ */

body.tds-theme .client-dash {
  --cd-radius: var(--tds-surface-radius, var(--tds-radius-xl));
  --cd-bg: var(--tds-surface-bg, var(--tds-bg-surface));
  --cd-shadow: var(--tds-surface-shadow, none);
}

body.tds-theme .client-dash__greeting-title {
  color: var(--tds-text-primary);
}

body.tds-theme .client-dash__greeting-sub {
  color: var(--tds-text-secondary);
}

body.tds-theme .client-dash-surface,
body.tds-theme .client-dash-hero,
body.tds-theme .client-dash-shortcut,
body.tds-theme .client-dash-prepaid,
body.tds-theme .client-dash-panel,
body.tds-theme .client-dash-empty-panel,
body.tds-theme .client-dash-card,
body.tds-theme .client-dash-section {
  background: var(--cd-bg, var(--tds-bg-surface));
  border: none;
  border-radius: var(--cd-radius, var(--tds-radius-xl));
  box-shadow: var(--cd-shadow, none);
}

body.tds-theme .client-dash-prepaid__label,
body.tds-theme .client-dash-prepaid__hint {
  color: var(--tds-text-secondary);
}

body.tds-theme .client-dash-prepaid__amount {
  color: var(--tds-blue500);
}

body.tds-theme .client-dash-actions {
  border-radius: var(--cd-radius, var(--tds-radius-xl));
  box-shadow: var(--cd-shadow, none);
}

body.tds-theme .client-dash-action {
  border-radius: var(--cd-inner-radius, var(--tds-radius-lg));
  box-shadow: var(--cd-shadow, none);
}

body.tds-theme .client-dash-shortcut:hover {
  box-shadow: var(--cd-shadow, none);
}

body.tds-theme .client-dash-hero__btn,
body.tds-theme a.client-dash-hero__btn {
  border-radius: var(--cd-btn-radius, var(--tds-radius-md));
  box-shadow: var(--cd-shadow, none);
  color: #fff !important;
}

body.tds-theme .client-dash-hero__btn:hover,
body.tds-theme .client-dash-hero__btn:focus,
body.tds-theme a.client-dash-hero__btn:hover,
body.tds-theme a.client-dash-hero__btn:focus {
  color: #fff !important;
}

/* ============================================
   Select / textarea consistency
   ============================================ */

body.tds-theme select.form-control,
body.tds-theme textarea.form-control {
  border: 1px solid var(--tds-border-default);
  border-radius: var(--tds-radius-md);
  background-color: var(--tds-bg-surface);
  color: var(--tds-text-primary);
}

body.tds-theme .form-control.error {
  border-color: var(--tds-red500);
  background-color: var(--tds-red50);
}

body.tds-theme .form-text.error-message {
  color: var(--tds-red500);
}

body.tds-theme .form-text.success-message {
  color: var(--tds-green500);
}

/* ============================================
   Employee edit tabs (employee-management.css)
   ============================================ */

body.tds-theme .employee-edit-tabs {
  background: var(--tds-bg-surface);
  border-bottom: 1px solid var(--tds-border-default);
  padding: 0 var(--tds-space-xl);
  gap: 0.25rem;
}

body.tds-theme .employee-edit-tab {
  padding: 0.875rem 1.25rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: var(--tds-typo6-size);
  font-weight: 500;
  color: var(--tds-text-secondary);
  border-radius: 0;
}

body.tds-theme .employee-edit-tab:hover {
  color: var(--tds-blue500);
  background: var(--tds-blue50);
}

body.tds-theme .employee-edit-tab.active {
  color: var(--tds-blue500);
  font-weight: 600;
  border-bottom-color: var(--tds-blue500);
  background: transparent;
}

body.tds-theme .employee-edit-input,
body.tds-theme .employee-edit-select,
body.tds-theme .employee-edit-textarea {
  border: 1px solid var(--tds-border-default);
  border-radius: var(--tds-radius-md);
  background: var(--tds-bg-surface);
  color: var(--tds-text-primary);
}

body.tds-theme .employee-edit-input:focus,
body.tds-theme .employee-edit-select:focus,
body.tds-theme .employee-edit-textarea:focus {
  border-color: var(--tds-blue500);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

/* dashboard-shell 내부는 tds-dashboard.css가 담당 */
body.tds-theme .dashboard-shell--tds .dashboard-card-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: var(--tds-space-sm);
}

/* Dark mode — TDS light theme enforced */
@media (prefers-color-scheme: dark) {
  body.tds-theme {
    background-color: var(--tds-bg-page) !important;
    color: var(--tds-text-primary) !important;
  }

  body.tds-theme .app-main {
    background-color: var(--tds-bg-page) !important;
  }

  body.tds-theme .login-container {
    background: var(--tds-bg-page) !important;
  }

  body.tds-theme .login-box {
    background: var(--tds-bg-surface) !important;
  }
}
