/* ═══════════════════════════════════════════════════════
   PROID Portal — Modern UI
   Clean, professional, top-1% design
═══════════════════════════════════════════════════════ */

@import url('https://fonts.cdnfonts.com/css/montserrat');

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

:root {
  --primary: #995e01;
  --primary-dk: #7a4a00;
  --primary-lt: #f9f0e6;
  --red: #dc2626;
  --red-dk: #b91c1c;
  --green: #16a34a;
  --green-lt: #dcfce7;
  --blue: #2563eb;
  --blue-lt: #eff6ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.14);
  --sidebar-w: 230px;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: #f0f2f5;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  max-height: 56px;
  margin: 0 auto;
}

.login-banner {
  background: var(--primary-lt);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--primary-dk);
  font-weight: 600;
  text-align: center;
  margin-bottom: 22px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 700;
}

.lang-link {
  color: #000;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all .15s;
  cursor: pointer;
}

.lang-link.active {
  background: var(--primary);
  color: var(--white);
}

.lang-link:hover:not(.active) {
  background: var(--gray-100);
  color: var(--gray-700);
}

.lang-sep {
  color: var(--gray-200);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #000;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(153, 94, 1, 0.12);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap input {
  padding-right: 40px;
}

.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: .5;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--gray-500);
}

.remember-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(.98);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(153, 94, 1, .25);
}

.btn-primary:hover {
  background: var(--primary-dk);
}

.btn-red {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(220, 38, 38, .2);
}

.btn-red:hover {
  background: var(--primary-dk);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}

.btn-ghost:hover {
  background: var(--gray-100);
}

.btn-dark {
  background: var(--gray-900);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--gray-700);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 11px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 10px;
}

.btn-login {
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 14px;
  padding: 13px;
}

.login-footer-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12px;
}

.login-footer-links a {
  color: var(--gray-400);
}

.login-footer-links a:hover {
  color: var(--primary);
}

/* Alert */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  border-left: 4px solid;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--red);
  color: #991b1b;
}

.alert-success {
  background: var(--green-lt);
  border-color: var(--green);
  color: #14532d;
}

.alert-info {
  background: var(--blue-lt);
  border-color: var(--blue);
  color: #1e3a8a;
}

.alert-warn {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

/* ══════════════════════════════════════════════════════
   DASHBOARD — TOP BAR
══════════════════════════════════════════════════════ */
.dashboard-body {
  min-height: 100vh;
  background: transparent;
}

.topbar {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-logo img {
  height: 36px;
}

.topbar-logo span {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-pills {
  display: flex;
  gap: 4px;
}

.lang-pills .lang-link {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
}

.lang-pills .lang-link.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.lang-pills .lang-link:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.topbar-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

.topbar-logout {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
}

.topbar-logout:hover {
  color: var(--red);
}

/* ══════════════════════════════════════════════════════
   DASHBOARD — LAYOUT
══════════════════════════════════════════════════════ */
.dashboard-wrap {
  display: flex;
  min-height: calc(100vh - 60px);
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 20px;
  gap: 24px;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.portal-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
}

.sidebar-inner {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  position: sticky;
  top: 80px;
}

.sidebar-nav {
  padding: 10px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-decoration: none;
  transition: all .15s;
  margin-bottom: 2px;
}

.sidebar-nav a .nav-icon {
  font-size: 16px;
}

.sidebar-nav a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: var(--primary);
  color: var(--white);
}

/* ══════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════ */
.portal-main {
  flex: 1;
  min-width: 0;
}

.content-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 28px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -.02em;
  margin-bottom: 20px;
  text-transform: uppercase;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
}

/* ══════════════════════════════════════════════════════
   STATS ROW
══════════════════════════════════════════════════════ */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 700;
  color: var(--gray-700);
}

.stat-pill .icon {
  font-size: 14px;
}

.stat-pill .val {
  color: var(--primary);
  font-weight: 800;
}

.stat-pill.green {
  background: var(--green-lt);
  color: var(--green);
}

.stat-pill.red {
  background: #fef2f2;
  color: var(--red);
}

.stat-pill.link {
  background: var(--blue-lt);
  color: var(--blue);
  cursor: pointer;
}

.stat-pill a {
  color: inherit;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   FILTERS ROW
══════════════════════════════════════════════════════ */
.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════
   INFO BOX
══════════════════════════════════════════════════════ */
.info-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  border-left: 4px solid;
}

.info-box.green {
  background: var(--green-lt);
  border-color: var(--green);
  color: #14532d;
}

.info-box.red {
  background: #fef2f2;
  border-color: var(--red);
  color: #991b1b;
}

.info-box.warn {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

/* ══════════════════════════════════════════════════════
   CARD GRID
══════════════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.card-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}

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

.card-banner {
  height: 90px;
  background: linear-gradient(135deg, var(--primary), #c8a84b);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-admin {
  background: #1e293b;
  color: #fbbf24;
}

.badge-disabled {
  background: var(--red);
  color: var(--white);
}

.card-avatar-wrap {
  text-align: center;
  margin-top: -26px;
  position: relative;
  z-index: 2;
}

.card-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--white);
  object-fit: cover;
  background: var(--gray-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 22px;
}

.card-info {
  padding: 8px 12px 4px;
  flex: 1;
}

.card-name {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.card-name:hover {
  color: var(--primary);
}

.card-code {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--gray-400);
  letter-spacing: .1em;
}

.card-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

.card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
}

.card-actions .btn {
  flex: 1;
  font-size: 11px;
  padding: 7px 6px;
}

.empty-state {
  text-align: center;
  color: var(--gray-400);
  padding: 56px 24px;
}

.empty-state p {
  font-size: 15px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   PRODUCT GRID
══════════════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.product-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
}

.product-item:hover {
  transform: translateY(-2px);
}

.product-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  margin-bottom: 10px;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ══════════════════════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════════════════════ */
.setting-wrap {
  max-width: 560px;
}

.setting-title {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: center;
  margin-bottom: 8px;
}

.setting-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
  line-height: 1.6;
}

.setting-subtitle strong {
  color: var(--gray-700);
}

.setting-subtitle ul {
  margin-left: 18px;
  margin-top: 6px;
}

.setting-subtitle li {
  margin-bottom: 4px;
}

.setting-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-form .form-group {
  margin-bottom: 0;
}

.helper-text {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 5px;
  font-style: italic;
}

.btn-update {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: background .15s;
}

.btn-update:hover {
  background: var(--primary-dk);
}

/* ══════════════════════════════════════════════════════
   CARD EDIT MODAL / INLINE FORM
══════════════════════════════════════════════════════ */
.edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.edit-overlay.open {
  display: flex;
}

.edit-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 760px;
  margin: auto;
  overflow: hidden;
}

.edit-modal-header {
  background: var(--primary);
  color: var(--white);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.edit-modal-header h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
}

.edit-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.edit-close:hover {
  color: var(--white);
}

.edit-modal-body {
  padding: 24px;
}

.edit-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 0;
}

.edit-tab {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gray-400);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}

.edit-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.edit-section {
  display: none;
}

.edit-section.active {
  display: block;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.edit-grid .form-group {
  margin-bottom: 0;
}

.edit-grid .full {
  grid-column: 1 / -1;
}

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* ══════════════════════════════════════════════════════
   COUNT LINE
══════════════════════════════════════════════════════ */
.count-line {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--gray-600);
}

.count-line span {
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dashboard-wrap {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .portal-sidebar {
    width: 100%;
  }

  .sidebar-inner {
    position: static;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 8px;
  }

  .sidebar-nav a {
    flex: 1;
    justify-content: center;
    padding: 9px 8px;
    font-size: 11px;
  }

  .sidebar-nav a .nav-icon {
    display: none;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }
}

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

  .topbar {
    padding: 0 14px;
  }

  .content-card {
    padding: 16px;
  }

  .login-card {
    padding: 28px 20px;
  }
}

/* ══════════════════════════════════════════════════════
   NEW HEADER — logo centered, lang pills, logged-in bar
══════════════════════════════════════════════════════ */
.portal-header-new {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.logged-in-bar-new {
  text-align: center;
  font-size: 13px;
  color: #4b5563;
  padding: 8px 16px;
  border-top: 1px solid var(--gray-200);
}

.logged-in-bar-new strong {
  color: var(--gray-900);
}

.logged-in-bar-new a {
  color: #dc2626;
  font-weight: 700;
}

/* Adjust dashboard wrap to account for taller header */
.dashboard-wrap {
  padding-top: 20px;
}

/* ── Filter row responsive ── */
@media(max-width:700px) {
  .dashboard-wrap>div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}