/* UniCheck Modern Responsive Design System */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-input: #1e293b;
  --border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
.navbar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-brand span.badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.btn-new {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* User Info Badge */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.role-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.role-tag.manager { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.role-tag.checker { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

/* Main Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem 1rem;
  flex: 1;
}

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.4rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Form Components */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

/* Uniform Section Accordion / Grid */
.uniform-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 1.25rem 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.size-qty-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Counter Control */
.counter-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-input);
}

.counter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  width: 36px;
  height: 42px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.counter-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

/* Status Badges */
.badge-status {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}
.badge-normal { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-warning { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-info { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Alert Messages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fde047; }
.alert-info { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3); color: #7dd3fc; }

/* Mobile Bottom Nav for PWA */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem;
  z-index: 1000;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.mobile-nav-item.active {
  color: var(--secondary);
}

/* Responsive Rules */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-nav { display: flex; }
  .container { padding-bottom: 5rem; }
  .size-qty-row { grid-template-columns: 1fr; }
}
