/* =============================================
   食堂发票管理系统 — Complete UI Redesign
   Sophisticated Financial Tool Aesthetic
   Deep Navy · Warm Cream · Gold Accents
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

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

:root {
  /* Core palette */
  --navy: #1e3a6b;
  --navy-light: #2a5090;
  --navy-hover: #3570b0;
  --gold: #c8963e;
  --gold-light: #dfb16a;
  --gold-glow: rgba(200,150,62,0.2);

  /* Surfaces */
  --bg: #f3f1ed;
  --bg-warm: #faf9f7;
  --card: #ffffff;
  --card-hover: #fcfbf9;

  /* Text */
  --text: #1a1a2e;
  --text-secondary: #5a6072;
  --text-muted: #8e92a0;

  /* Borders */
  --border: #e6e3dd;
  --border-light: #f0ede8;

  /* Functional */
  --green: #4a8c6a;
  --green-bg: #eaf5ef;
  --red: #c45a5a;
  --red-bg: #fcefef;
  --blue: #4285F4;
  --blue-bg: #e8f0fe;
  --amber: #c8963e;
  --amber-bg: #fdf6eb;

  /* Dimensions */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --sidebar-w: 220px;

  /* Typography */
  --font: "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --font-en: "Inter", -apple-system, sans-serif;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { font-size:14px; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration:none; transition:color 0.2s var(--ease); }
a:hover { color: var(--gold); }

/* --- Layout --- */
.app { display:flex; min-height:100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display:flex;
  flex-direction:column;
  flex-shrink:0;
  position:sticky;
  top:0;
  height:100vh;
  z-index:100;
  overflow:hidden;
}

.sidebar-header {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink:0;
}
.sidebar-header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #7baaf7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-header .subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  letter-spacing: 1px;
  font-weight: 300;
}

.sidebar-nav {
  flex:1;
  padding: 10px 0;
  overflow-y:auto;
}
.sidebar-nav::-webkit-scrollbar { width:3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1); border-radius:3px; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.25s var(--ease);
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
  border-left-color: rgba(200,150,62,0.3);
}
.sidebar-nav a.active {
  color: var(--gold);
  background: rgba(200,150,62,0.08);
  border-left-color: var(--gold);
  font-weight: 500;
}
.sidebar-nav a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink:0;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink:0;
}
.sidebar-footer .user-name {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sidebar-footer .logout-btn {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s var(--ease);
  flex-shrink:0;
}
.sidebar-footer .logout-btn:hover { color: var(--red); }

/* --- Main Content Area --- */
.main-content {
  flex:1;
  overflow-y:auto;
  padding: 28px 32px;
  min-width:0;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.page-header .text-muted {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}
.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card-header:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }

/* Card sections (for multi-section cards) */
.card-section + .card-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
}
.stat-card.stat-ok::before { background: var(--green); }
.stat-card.stat-warn::before { background: var(--amber); }
.stat-card.stat-danger::before { background: var(--red); }
.stat-card .stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.stat-card .stat-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-family: var(--font-en);
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* --- Tables --- */
.table-wrap { overflow-x:auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  background: var(--bg-warm);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tbody tr {
  transition: background 0.15s var(--ease);
}
.table tbody tr:hover td {
  background: var(--card-hover);
}
.table tbody tr:last-child td { border-bottom: none; }
.table .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}
.table .empty a { color: var(--blue); font-weight:500; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2px; }
.text-red { color: var(--red); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }
.action-cell { white-space: nowrap; display: flex; gap: 4px; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-active, .badge-archived, .badge-success { background: var(--green-bg); color: var(--green); }
.badge-pending, .badge-disabled, .badge-warning { background: var(--amber-bg); color: #8a6a2e; }
.badge-danger, .badge-error { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--blue-bg); color: var(--blue); }

/* --- Forms --- */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  transition: all 0.2s var(--ease);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #ccc8c0;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-row .form-group { flex:1; min-width:120px; }
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-row select,
.filter-row input {
  padding: 7px 10px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  background: #fff;
  outline: none;
  transition: all 0.2s var(--ease);
}
.filter-row select:focus,
.filter-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* --- Button System --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s var(--ease);
  background: #f0ece6;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}
.btn:hover { background: #e5e0d8; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #3367d6; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #3d7a5c; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a84848; }

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #b8883a; }
.btn-gold:active { background: #a07830; }

.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-lg { padding: 10px 28px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(200,150,62,0.04); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 4px 10px;
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.amt-input {
  width: 130px;
  padding: 5px 10px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s var(--ease);
}
.amt-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* --- Autocomplete (enhanced) --- */
.ac-wrap { position: relative; display: inline-block; }
.ac-input {
  width: 180px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  background: #fff;
  font-family: var(--font);
  transition: all 0.2s var(--ease);
}
.ac-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  animation: dropdownIn 0.15s var(--ease);
}
@keyframes dropdownIn {
  from { opacity:0; transform:translateY(-6px); }
  to { opacity:1; transform:translateY(0); }
}
.ac-dropdown .ac-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s var(--ease);
}
.ac-dropdown .ac-item:hover,
.ac-dropdown .ac-item.active { background: var(--gold-glow); color: var(--text); }
.ac-dropdown .ac-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* --- Drop Zone --- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  background: var(--bg-warm);
  position: relative;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px var(--gold-glow);
}
.drop-zone .drop-icon { font-size: 38px; margin-bottom: 8px; display:block; }
.drop-zone p { color: var(--text-muted); font-size: 14px; font-weight:400; }
.drop-zone .drop-hint { font-size: 12px; color: #bbb; margin-top: 6px; }

/* --- Progress --- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: #ecebe8;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width 0.4s var(--ease-bounce);
}
.progress-text { font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.progress-detail { font-size: 12px; color: var(--text-muted); }

/* --- Summary Bar --- */
.summary-bar {
  padding: 12px 16px;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid var(--gold);
  margin-bottom: 12px;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  width: 100%;
  position: relative;
}
.login-inner {
  display: flex;
  min-height: 100vh;
}
.login-brand {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
}
.login-brand-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0a1628 0%, #132244 40%, #1a3a6b 100%);
  z-index: 0;
}
.login-brand-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(66,133,244,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200,150,62,0.06) 0%, transparent 50%);
  z-index: 1;
}
.login-brand-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  max-width: 380px;
}
.login-brand-icon {
  margin-bottom: 20px;
  color: rgba(255,255,255,0.6);
  display: flex;
  justify-content: center;
}
.login-brand-content h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 60%, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-brand-sub {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 20px;
}
.login-brand-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 20px;
  border-radius: 1px;
}
.login-brand-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin-bottom: 24px;
}
.login-brand-features {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.feature-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
}
/* Geometric decoration */
.login-brand-bg::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  z-index: 1;
}

/* Form side */
.login-form-wrap {
  width: 440px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px;
  position: relative;
}
.login-form-inner {
  width: 100%;
  max-width: 340px;
}
.login-form-header {
  margin-bottom: 28px;
}
.login-form-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.login-form-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Floating label fields */
.login-field {
  position: relative;
  margin-bottom: 18px;
}
.login-field input {
  width: 100%;
  height: 52px;
  padding: 22px 14px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.login-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-bg);
}
.login-field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: all 0.2s var(--ease);
  background: var(--card);
  padding: 0 2px;
}
.login-field input:focus + label,
.login-field input:not(:placeholder-shown) + label {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--blue);
  font-weight: 500;
}
.login-field input:focus + label { color: var(--blue); }

.login-page .alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-page .alert-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #f0d0d0;
}

.login-page .btn-full {
  margin-top: 4px;
  height: 48px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

.login-creds {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.creds-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}
.creds-row + .creds-row { border-top: 1px solid var(--border-light); padding-top: 8px; margin-top: 8px; }
.creds-role {
  color: var(--text-muted);
  font-weight: 500;
}
.creds-acct {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

@keyframes loginIn {
  from { opacity:0; transform:translateY(12px); }
  to { opacity:1; transform:translateY(0); }
}
.login-form-inner {
  animation: loginIn 0.4s var(--ease);
}
.login-brand-content {
  animation: loginIn 0.5s var(--ease) 0.1s both;
}

@media (max-width: 768px) {
  .login-inner { flex-direction: column; }
  .login-brand { padding: 40px 24px; min-height: 280px; }
  .login-brand-content h1 { font-size: 24px; }
  .login-form-wrap { width: 100%; padding: 32px 24px; }
}

/* --- Modal --- */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(30,58,107,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalFadeIn 0.2s var(--ease);
}
@keyframes modalFadeIn {
  from { opacity:0; }
  to { opacity:1; }
}
.modal-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  width: 440px;
  max-width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalContentIn 0.25s var(--ease-bounce);
}
@keyframes modalContentIn {
  from { opacity:0; transform:translateY(10px) scale(0.97); }
  to { opacity:1; transform:translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
  line-height: 1;
  background: none;
  border: none;
}
.modal-close:hover { color: var(--text); }
.modal h3 {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: all 0.35s var(--ease-bounce);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.succ { background: linear-gradient(135deg, var(--green), #3d7a5c); }
.toast.err { background: linear-gradient(135deg, var(--red), #a84848); }
.toast.info { background: linear-gradient(135deg, var(--blue), #3367d6); }

/* --- Status Feedback Box (cover generation) --- */
.status-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  animation: statusIn 0.3s var(--ease);
}
.status-box.status-info {
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.status-box.status-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #c8e0d4;
}
.status-box.status-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #ecc8c8;
}
@keyframes statusIn {
  from { opacity:0; transform:translateY(-6px); }
  to { opacity:1; transform:translateY(0); }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity:0.5; }
.empty-state p { font-size: 14px; }
.empty-state a { color: var(--blue); font-weight: 500; }

/* --- Utility --- */
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { width: 56px; overflow: visible; }
  .sidebar-header h1 { font-size: 12px; }
  .sidebar-header .subtitle { display:none; }
  .sidebar-nav a { padding: 12px 18px; justify-content: center; }
  .sidebar-nav a .nav-icon { margin: 0; }
  .sidebar-nav a span { display: none; }
  .sidebar-footer .user-name { display:none; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row label { width: 100%; }
  .filter-row input,
  .filter-row select { width: 100% !important; }
  .form-row { flex-direction: column; }
  .form-row .form-group { min-width: auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-info { white-space: nowrap; }
.pagination-btns { display: flex; align-items: center; gap: 6px; }
.pagination-jump {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  min-width: 64px;
}
.pagination-jump:focus { outline: none; border-color: var(--blue); }
.pagination-limit {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.pagination-limit select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}
.pagination-limit select:focus { outline: none; border-color: var(--blue); }

/* --- Cover Preview --- */
.cover-preview {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  font-size: 13px;
  line-height: 1.8;
  min-height: 80px;
}
.preview-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
}
.pv-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.pv-body { max-width: 500px; margin: 0 auto; }
.pv-row {
  display: flex;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.pv-row:last-child { border-bottom: none; }
.pv-label {
  flex: 0 0 80px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.pv-val {
  flex: 1;
  color: var(--text-primary);
  word-break: break-all;
}
.pv-amt { font-family: var(--font-mono); font-weight: 600; color: var(--green); }
.pv-usage { color: var(--navy); font-weight: 500; }
.pv-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
