/* ============================================
   DSS Inventory System - Modern Admin Theme
   Inspired by Soft UI & Modern Admin Templates
   ============================================ */

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

:root {
  --sidebar-width: 260px;
  --header-height: 70px;
  --sidebar-bg: linear-gradient(to bottom, #0c4a6e, #075985, #0369a1);
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #8b5cf6;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

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

body {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  background: var(--body-bg);
  color: var(--text-dark);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-logo i {
  font-size: 1.75rem;
  color: #38bdf8;
}

.sidebar-menu {
  padding: 1rem 0;
}

.menu-category {
  padding: 0.75rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-menu li a i {
  font-size: 1.125rem;
  width: 1.5rem;
}

.nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-menu li a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-left-color: #38bdf8;
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggle {
  font-size: 1.5rem;
  color: var(--text-muted);
  padding: 0.25rem;
}

.sidebar-toggle:hover {
  color: var(--text-dark);
}

.header-search {
  position: relative;
  width: 280px;
}

.header-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-search input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: #f8fafc;
  font-size: 0.875rem;
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-icon:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.header-icon i {
  font-size: 1.25rem;
}

.header-icon .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-user:hover {
  background: #f1f5f9;
}

.header-user .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-dark);
}

.header-user .dropdown-toggle::after {
  display: none;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== CONTENT WRAPPER ==================== */
.content-wrapper {
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.breadcrumb {
  margin: 0.25rem 0 0 0;
  padding: 0;
  background: none;
  font-size: 0.8125rem;
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1rem 1.25rem;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

/* ==================== TABLES ==================== */
.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

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

.table tbody tr:hover {
  background: #f8fafc;
}

.table-bordered {
  border: none;
}
.table-bordered th,
.table-bordered td {
  border: none;
  border-bottom: 1px solid var(--border-color);
}

.table-warning {
  background: rgba(245, 158, 11, 0.1) !important;
}
.table-danger {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #16a34a;
  color: #fff;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  color: #fff;
}
.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: #d97706;
  color: #fff;
}
.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover {
  background: #7c3aed;
  color: #fff;
}
.btn-secondary {
  background: #e2e8f0;
  color: var(--text-dark);
}
.btn-secondary:hover {
  background: #cbd5e1;
  color: var(--text-dark);
}

.btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}
.btn-group {
  display: inline-flex;
  gap: 0.25rem;
}
.btn-group .btn {
  border-radius: 0.375rem;
}

/* ==================== FORMS ==================== */
.form-control,
.form-select {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.375rem;
}

/* ==================== BADGES ==================== */
.badge {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

.badge.bg-success {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #16a34a !important;
}
.badge.bg-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
}
.badge.bg-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #d97706 !important;
}
.badge.bg-info {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #0284c7 !important;
}
.badge.bg-secondary {
  background: rgba(100, 116, 139, 0.15) !important;
  color: #475569 !important;
}

/* ==================== ALERTS ==================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #854d0e;
}

/* ==================== MODALS ==================== */
.modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-body {
  padding: 1.25rem;
}
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c4a6e, #075985, #0369a1);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-card .card-header {
  text-align: center;
  padding: 2rem 2rem 1rem;
  border: none;
}

.login-card .card-header i {
  font-size: 3rem;
  color: var(--primary);
}
.login-card .card-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}
.login-card .card-header p {
  color: var(--text-muted);
  margin: 0;
}
.login-card .card-body {
  padding: 1.5rem 2rem 2rem;
}
.login-card .btn-primary {
  width: 100%;
  padding: 0.75rem;
}
.login-card .input-group-text {
  background: #f8fafc;
  border-right: none;
  color: var(--text-muted);
}
.login-card .input-group .form-control {
  border-left: none;
}

/* ==================== UTILITIES ==================== */
.text-accent {
  color: var(--primary) !important;
}
.text-muted {
  color: var(--text-muted) !important;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== SELECT2 ==================== */
.select2-container--bootstrap-5 .select2-selection {
  border: 1px solid var(--border-color) !important;
  border-radius: 0.5rem !important;
  min-height: 42px !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1) !important;
}
