/* =========================================================
   Corporate Clean (企业简洁风) Design System - Production CSS
   Strict adherence to Corporate Clean tokens, WCAG compliance & swift motion
   ========================================================= */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --color-bg: #f8fafc; /* bg-slate-50 */
  --color-card-bg: #ffffff;
  --color-primary: #2563eb; /* blue-600 */
  --color-primary-hover: #1d4ed8; /* blue-700 */
  --color-text-title: #0f172a; /* slate-900 / gray-900 */
  --color-text-body: #334155; /* slate-700 / gray-700 */
  --color-text-muted: #64748b; /* slate-500 / gray-500 */
  --color-border: #e2e8f0; /* gray-200 / slate-200 */

  --shadow-corp-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-corp-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transform: none !important;
  }
}

/* Corporate Clean Cards */
.corp-card {
  background-color: #ffffff;
  border-radius: 0.75rem; /* rounded-xl */
  box-shadow: var(--shadow-corp-sm);
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  transition: all 200ms ease-out;
}
.corp-card:hover {
  transform: translateY(-2px); /* hover:-translate-y-0.5 */
  box-shadow: var(--shadow-corp-md);
}

/* Corporate Clean Buttons */
.btn-corp-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem; /* px-4 py-2 */
  border-radius: 0.5rem; /* rounded-lg */
  font-size: 0.875rem;
  font-weight: 500;
  background-color: #2563eb; /* bg-blue-600 */
  color: #ffffff !important;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-corp-sm);
  transition: all 150ms ease-out;
}
.btn-corp-primary:hover {
  background-color: #1d4ed8; /* hover:bg-blue-700 */
  transform: translateY(-2px);
  box-shadow: var(--shadow-corp-md);
}
.btn-corp-primary:active {
  transform: scale(0.98) translateY(0);
}
.btn-corp-primary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 */
}

.btn-corp-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem; /* rounded-lg */
  font-size: 0.875rem;
  font-weight: 500;
  background-color: #ffffff;
  color: #334155 !important;
  border: 1px solid #cbd5e1; /* border-gray-300 */
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-corp-sm);
  transition: all 150ms ease-out;
}
.btn-corp-secondary:hover {
  background-color: #f8fafc;
  color: #0f172a !important;
  border-color: #94a3b8;
  transform: translateY(-2px);
}
.btn-corp-secondary:active {
  transform: scale(0.98) translateY(0);
}
.btn-corp-secondary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

.btn-corp-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: #fef2f2;
  color: #dc2626 !important;
  border: 1px solid #fecaca;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease-out;
}
.btn-corp-danger:hover {
  background-color: #fee2e2;
  transform: translateY(-2px);
}
.btn-corp-danger:active {
  transform: scale(0.98) translateY(0);
}

/* Corporate Clean Inputs */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
  display: block;
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.5rem; /* rounded-lg */
  font-size: 0.875rem;
  color: #0f172a;
  padding: 0.5rem 0.75rem; /* px-3 py-2 */
  outline: none;
  box-shadow: var(--shadow-corp-sm);
  transition: all 150ms ease-out;
  box-sizing: border-box;
}

/* 带有左侧图标的输入框 */
.input-with-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-with-icon-wrapper .input-icon-left,
.input-icon-left {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #94a3b8;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.input-with-icon-wrapper input,
input.has-icon-left {
  padding-left: 2.375rem !important;
}

/* WCAG-compliant Focus Ring Offset */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6 !important; /* focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 */
}

/* Corporate Badges */
.corp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem; /* rounded-lg */
  font-size: 0.75rem;
  font-weight: 500;
}
.corp-badge-blue { background-color: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.corp-badge-green { background-color: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.corp-badge-amber { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.corp-badge-red { background-color: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.corp-badge-gray { background-color: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* Corporate Table */
.corp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.corp-table th {
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.corp-table td {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #334155;
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  transition: background-color 150ms ease-out;
}
.corp-table tbody tr:hover td {
  background-color: #f8fafc; /* hover:bg-gray-50 */
}

/* Modal */
.dash-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}
.dash-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.dash-modal-content {
  background-color: #ffffff;
  border-radius: 0.75rem; /* rounded-xl */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 32rem;
  transform: scale(0.97);
  transition: all 150ms ease-out;
}
.dash-modal-backdrop.active .dash-modal-content {
  transform: scale(1);
}

/* Sidebar Responsive */
#sidebar {
  transition: transform 200ms ease-out;
}
@media (max-width: 767px) {
  #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
}
