/* Zadok Foundation - Modern Executive Admin Dashboard Theme */
@import url('/assets/css/design-tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --admin-font-heading: 'Sora', sans-serif;
  --admin-font-body: 'DM Sans', sans-serif;
  
  --admin-sidebar-width: 270px;
  --admin-header-height: 76px;
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  
  /* Modern Dark Sidebar Palette */
  --admin-sidebar-bg: #0b1320;
  --admin-sidebar-card: #131f33;
  --admin-sidebar-active: linear-gradient(135deg, #004c11 0%, #166621 100%);
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-text-active: #ffffff;
  
  /* Brand Tokens */
  --zdk-green-grad: linear-gradient(135deg, #004c11 0%, #166621 100%);
  --zdk-amber-grad: linear-gradient(135deg, #FFBC13 0%, #d99c00 100%);
  --zdk-blue-grad: linear-gradient(135deg, #4059aa 0%, #293c7a 100%);
  --zdk-purple-grad: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  
  --zdk-border-soft: rgba(226, 232, 240, 0.8);
  --zdk-radius-main: 20px;
  --zdk-radius-pill: 9999px;
  
  --zdk-shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
  --zdk-shadow-hover: 0 20px 40px -10px rgba(0, 76, 17, 0.12);
}

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

body {
  font-family: var(--admin-font-body);
  background-color: var(--admin-bg);
  color: #1e293b;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading, .font-headline {
  font-family: var(--admin-font-heading);
  font-weight: 700 !important;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   DARK DOODLE LOGIN PAGE STYLING
   ========================================================================== */
body.login-page {
  background-color: #080d1a;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(0, 76, 17, 0.4) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 188, 19, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(64, 89, 170, 0.2) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h40v40H40V0zM0 40h40v40H0V40z'/%3E%3Ccircle cx='20' cy='20' r='6' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='60' cy='60' r='8' stroke='%23FFBC13' stroke-opacity='0.08' stroke-width='1.5' fill='none'/%3E%3Cpath d='M10 70 Q 20 50, 30 70 T 50 70' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='2' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 3rem 2.25rem;
  position: relative;
  z-index: 10;
}

.login-logo {
  text-align: center;
  margin-bottom: 2.25rem;
}

.login-logo img {
  height: 60px;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 4px 12px rgba(255, 188, 19, 0.3));
}

.login-logo h2 {
  font-size: 1.5rem;
  color: #ffffff;
  margin: 0;
}

.login-logo p {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.demo-credentials-box {
  background: rgba(0, 76, 17, 0.25);
  border: 1px dashed rgba(255, 188, 19, 0.4);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.75rem;
  font-size: 0.825rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-credentials-box code {
  color: var(--zdk-amber);
  background: rgba(0,0,0,0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.form-label-dark {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-control-dark {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control-dark:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--zdk-amber);
  box-shadow: 0 0 0 4px rgba(255, 188, 19, 0.2);
  color: #ffffff;
}

.form-control-dark::placeholder {
  color: #64748b;
}

.input-group-text-dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

/* ==========================================================================
   MAIN DASHBOARD LAYOUT & CURVED COMPONENTS
   ========================================================================== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Modern Dark Sidebar */
.menu-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Collapsed Sidebar State for Desktop */
body.sidebar-collapsed .menu-sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed .page-container {
  margin-left: 0 !important;
  width: 100% !important;
}

.logo-header {
  height: var(--admin-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo-header a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--admin-font-heading);
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-header img {
  height: 44px;
  width: auto;
  border-radius: 12px;
}

.navbar-sidebar {
  padding: 1.5rem 1rem;
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Hide sidebar scrollbar but keep it scrollable */
.navbar-sidebar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.navbar-sidebar .nav-section-title {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  font-weight: 700;
  font-family: var(--admin-font-heading);
}

.navbar-sidebar ul.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-sidebar li {
  margin-bottom: 0.35rem;
}

.navbar-sidebar li a {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.8rem 1.15rem;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-sidebar li a i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: #64748b;
  transition: all 0.25s ease;
}

.navbar-sidebar li a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(4px);
}

.navbar-sidebar li a:hover i {
  color: var(--zdk-amber);
}

.navbar-sidebar li.active a {
  background: var(--admin-sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 8px 20px -4px rgba(0, 76, 17, 0.4);
}

.navbar-sidebar li.active a i {
  color: var(--zdk-amber);
}

/* Page Container & Header Desktop */
.page-container {
  margin-left: var(--admin-sidebar-width);
  width: calc(100% - var(--admin-sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.header-desktop {
  height: var(--admin-header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--zdk-border-soft);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.25rem;
}

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

.sidebar-toggle-btn {
  background: #f1f5f9;
  border: none;
  font-size: 1.2rem;
  color: #334155;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--zdk-primary-soft);
  color: var(--zdk-primary);
}

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

.header-search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  border-radius: var(--zdk-radius-pill);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  font-family: var(--admin-font-body);
}

.header-search input:focus {
  outline: none;
  border-color: var(--zdk-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 76, 17, 0.12);
}

.header-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

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

.account-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--zdk-radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-item:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.account-item .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--zdk-green-grad);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 76, 17, 0.3);
}

.account-item .info {
  text-align: left;
}

.account-item .name {
  font-weight: 700;
  font-size: 0.875rem;
  color: #0f172a;
  line-height: 1.2;
}

.account-item .role {
  font-size: 0.75rem;
  color: #64748b;
}

/* Main Content Body */
.main-content {
  padding: 2.25rem;
  flex-grow: 1;
}

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

.page-header .title-group h1 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
}

.page-header .title-group p {
  color: #64748b;
  font-size: 0.95rem;
}

/* Curved Modern Cards */
.zdk-card {
  background: #ffffff;
  border-radius: var(--zdk-radius-main);
  border: 1px solid var(--zdk-border-soft);
  box-shadow: var(--zdk-shadow-soft);
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.zdk-card:hover {
  box-shadow: var(--zdk-shadow-hover);
  transform: translateY(-2px);
}

.zdk-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
}

.zdk-stat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.1);
}

.zdk-stat-card .icon-primary {
  background: var(--zdk-green-grad);
  color: #ffffff;
}

.zdk-stat-card .icon-amber {
  background: var(--zdk-amber-grad);
  color: #232026;
}

.zdk-stat-card .icon-blue {
  background: var(--zdk-blue-grad);
  color: #ffffff;
}

.zdk-stat-card .icon-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.zdk-stat-card .stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.zdk-stat-card .stat-info h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zdk-stat-card .stat-info p {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin: 0.15rem 0 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modern Pill Buttons */
.btn-zdk {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  padding: 0.75rem 1.6rem;
  border-radius: var(--zdk-radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  text-decoration: none;
  font-family: var(--admin-font-heading);
}

.btn-zdk-primary {
  background: var(--zdk-green-grad);
  color: #ffffff !important;
  box-shadow: 0 8px 20px -4px rgba(0, 76, 17, 0.35);
}

.btn-zdk-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(0, 76, 17, 0.45);
}

.btn-zdk-amber {
  background: var(--zdk-amber-grad);
  color: #232026 !important;
  box-shadow: 0 8px 20px -4px rgba(255, 188, 19, 0.4);
}

.btn-zdk-amber:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(255, 188, 19, 0.55);
}

.btn-zdk-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.btn-zdk-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-zdk-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff !important;
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.35);
}

.btn-zdk-danger:hover {
  transform: translateY(-2px);
}

/* Sleek Modern Badges */
.zdk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--zdk-radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  font-family: var(--admin-font-heading);
}

.zdk-table .zdk-badge {
  white-space: nowrap;
  padding: 0.3rem 0.75rem;
  display: inline-flex;
}

.zdk-badge-active, .zdk-badge-open, .zdk-badge-instock {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.zdk-badge-warning, .zdk-badge-lowstock {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.zdk-badge-danger, .zdk-badge-closed, .zdk-badge-outstock {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.zdk-badge-info, .zdk-badge-replied {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Curved Modern Data Tables */
.table-responsive {
  background: #ffffff;
  border-radius: var(--zdk-radius-main);
  border: 1px solid var(--zdk-border-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--zdk-shadow-soft);
  margin-bottom: 1.5rem;
  width: 100%;
}

.zdk-table {
  width: 100%;
  min-width: 820px; /* Guarantees zero compression on mobile screens */
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.zdk-table th {
  background: #f8fafc;
  padding: 1.15rem 1.25rem;
  font-weight: 700;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  font-family: var(--admin-font-heading);
  white-space: nowrap;
}

.zdk-table td {
  padding: 1.15rem 1.25rem;
  font-size: 0.925rem;
  line-height: 1.5;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.zdk-table tbody tr {
  transition: background-color 0.2s ease;
}

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

.zdk-table .item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.action-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--zdk-primary-soft);
  color: var(--zdk-primary);
  border-color: var(--zdk-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 76, 17, 0.15);
}

/* Image Uploader Dropzone Styling */
.zdk-uploader-wrapper {
  width: 100%;
}

.zdk-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  padding: 1rem;
  transition: all 0.25s ease;
  cursor: pointer;
}

.zdk-dropzone:hover, .zdk-dropzone.dropzone-active {
  border-color: var(--zdk-primary);
  background: var(--zdk-primary-soft);
  transform: scale(1.01);
}

.zdk-dropzone .dropzone-icon i {
  color: var(--zdk-primary);
}

/* Curved Modals */
.modal-content {
  border-radius: 26px;
  border: none;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: var(--zdk-primary-soft);
  border-bottom: 1px solid var(--zdk-border);
  padding: 1.35rem 2rem;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
}

.modal-header .modal-title {
  font-family: var(--admin-font-heading);
  font-weight: 800;
  color: var(--zdk-primary-dark);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid #f1f5f9;
  padding: 1.25rem 2rem;
}

/* Mobile Sidebar Drawer Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .menu-sidebar {
    transform: translateX(-100%);
  }
  
  .menu-sidebar.show-sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay.show-overlay {
    display: block;
  }
  
  .page-container {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .header-desktop {
    padding: 0 1.25rem;
  }

  .header-search {
    width: 180px;
  }

  .main-content {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 1.25rem 1rem;
  }

  .header-desktop {
    padding: 0 1rem;
  }

  .page-header {
    margin-bottom: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .page-header .title-group h1 {
    font-size: 1.5rem;
  }

  .page-header .action-buttons {
    width: 100%;
  }

  .page-header .action-buttons .btn-zdk {
    flex: 1;
    justify-content: center;
    font-size: 0.825rem;
    padding: 0.65rem 1rem;
  }

  .zdk-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .zdk-stat-card {
    gap: 0.85rem;
  }

  .zdk-stat-card .icon-box {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    border-radius: 12px;
  }

  .zdk-table th, .zdk-table td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .account-item .info {
    display: none;
  }

  .account-item {
    padding: 0.25rem;
    border: none;
    background: transparent;
  }

  .zdk-stat-card .stat-info h3 {
    font-size: 1.2rem;
  }

  .zdk-stat-card .stat-info p {
    font-size: 0.75rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-body {
    padding: 1.25rem 1rem;
  }

  .modal-header, .modal-footer {
    padding: 1rem;
  }
}
