/*
 * Qudra Charge Connect — Lovable visual system
 * Source project: Charge Connect Reimagined
 * Project revision: 555f1a81756ca0eb12da2fe3f30517fcf279b313
 *
 * This file is deliberately loaded after the compiled application stylesheet.
 * It changes visual tokens and component surfaces only; ERP workflows remain in
 * the tested v9 bundles.
 */

:root,
html[data-theme="qudra-green"],
html[data-theme="qudra-green-light"] {
  --radius: .75rem;

  --app-bg: #f4f1ea;
  --surface: #ffffff;
  --surface-secondary: #f2eee5;
  --surface-elevated: #ffffff;
  --surface-hover: #ece7dc;
  --sidebar-bg: #012a20;
  --header-bg: rgba(255, 255, 255, .92);

  --primary: #012a20;
  --primary-hover: #064638;
  --primary-light: rgba(1, 42, 32, .09);
  --primary-foreground: #fbfaf6;
  --primary-deep: #012a20;
  --primary-glow: #187f78;

  --secondary: #187f78;
  --secondary-hover: #106b65;
  --secondary-foreground: #ffffff;
  --accent: #d6b56d;
  --accent-hover: #c9a24e;
  --accent-foreground: #012a20;
  --gold: #d6b56d;
  --gold-foreground: #012a20;

  --text-main: #17362e;
  --text-secondary: #50675f;
  --text-muted: #6f817a;
  --background: #f8f6f0;
  --foreground: #17362e;
  --card: #ffffff;
  --card-foreground: #17362e;
  --popover: #ffffff;
  --popover-foreground: #17362e;
  --muted: #f1eee6;
  --muted-foreground: #60736b;

  --border: #ded9ce;
  --border-strong: #c9c1b3;
  --border-soft: rgba(24, 127, 120, .18);
  --border-active: rgba(24, 127, 120, .62);
  --input: #c9c1b3;
  --ring: #187f78;

  --success: #27875b;
  --warning: #c9892e;
  --danger: #c94d42;
  --destructive: #c94d42;
  --destructive-foreground: #ffffff;
  --info: #367f9f;

  --sidebar: #012a20;
  --sidebar-foreground: #e9ede9;
  --sidebar-primary: #d6b56d;
  --sidebar-primary-foreground: #012a20;
  --sidebar-accent: rgba(214, 181, 109, .15);
  --sidebar-accent-foreground: #fffaf0;
  --sidebar-border: #16483b;
  --sidebar-ring: #d6b56d;

  --gradient-brand: linear-gradient(135deg, #012a20 0%, #0a5146 58%, #187f78 100%);
  --gradient-header: linear-gradient(120deg, #012a20, #0a5146);
  --gradient-gold: linear-gradient(100deg, #d6b56d, #ead7a7);
  --shadow: 0 1px 2px rgba(1, 42, 32, .05), 0 14px 34px -24px rgba(1, 42, 32, .34);
  --shadow-card: var(--shadow);
  --shadow-brand: 0 12px 30px -16px rgba(24, 127, 120, .48);
  --shadow-gold: 0 12px 30px -16px rgba(214, 181, 109, .62);

  --erp-table-header: #f2eee5;
  --erp-table-row: #ffffff;
  --erp-table-alt: #fbfaf7;
  --erp-table-hover: #eef5f1;
  --erp-input-bg: #ffffff;
  --erp-input-border: #c9c1b3;
  --erp-focus-border: #187f78;
}

html.dark,
html[data-theme="qudra-reverse"] {
  --app-bg: #0a1512;
  --surface: #10211c;
  --surface-secondary: #142a23;
  --surface-elevated: #173128;
  --surface-hover: #1d3b31;
  --sidebar-bg: #061f18;
  --header-bg: rgba(10, 21, 18, .92);
  --primary: #d6b56d;
  --primary-hover: #e5ce99;
  --primary-light: rgba(214, 181, 109, .14);
  --primary-foreground: #012a20;
  --secondary: #3aa89f;
  --secondary-hover: #62c2b9;
  --secondary-foreground: #05241c;
  --accent: #d6b56d;
  --accent-hover: #e5ce99;
  --accent-foreground: #012a20;
  --text-main: #f4f1ea;
  --text-secondary: #c1cec8;
  --text-muted: #92a89e;
  --background: #0a1512;
  --foreground: #f4f1ea;
  --card: #10211c;
  --card-foreground: #f4f1ea;
  --popover: #142a23;
  --popover-foreground: #f4f1ea;
  --muted: #142a23;
  --muted-foreground: #b2c2ba;
  --border: #29443a;
  --border-strong: #3a5a4e;
  --input: #3a5a4e;
  --ring: #d6b56d;
  --sidebar: #061f18;
  --sidebar-foreground: #e9ede9;
  --sidebar-primary: #d6b56d;
  --sidebar-primary-foreground: #012a20;
  --sidebar-accent: rgba(214, 181, 109, .16);
  --sidebar-accent-foreground: #fffaf0;
  --sidebar-border: #1c4034;
  --sidebar-ring: #d6b56d;
  --erp-table-header: #142a23;
  --erp-table-row: #10211c;
  --erp-table-alt: #12261f;
  --erp-table-hover: #1d3b31;
  --erp-input-bg: #142a23;
  --erp-input-border: #3a5a4e;
  --erp-focus-border: #d6b56d;
}

html,
body,
button,
input,
select,
textarea {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: -.02em;
}

body {
  background: var(--background) !important;
  color: var(--foreground) !important;
}

/* ERP shell: Lovable's cream workspace, crisp white cards and green rail. */
[data-sidebar="sidebar"] {
  background: var(--sidebar) !important;
  color: var(--sidebar-foreground) !important;
  border-color: var(--sidebar-border) !important;
}

[data-sidebar="menu-button"] {
  border-radius: .625rem !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

[data-sidebar="menu-button"]:hover,
[data-sidebar="menu-button"][data-active="true"] {
  background: var(--sidebar-accent) !important;
  color: var(--sidebar-accent-foreground) !important;
}

[data-sidebar="menu-button"][data-active="true"] {
  box-shadow: inset 3px 0 0 var(--sidebar-primary);
}

[dir="rtl"] [data-sidebar="menu-button"][data-active="true"] {
  box-shadow: inset -3px 0 0 var(--sidebar-primary);
}

[data-sidebar="group-label"] {
  color: rgba(233, 237, 233, .56) !important;
  font-size: .68rem !important;
  font-weight: 700 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body:not(:has(.qc-portal)) header.sticky {
  background: var(--header-bg) !important;
  border-color: var(--border) !important;
  backdrop-filter: blur(16px) saturate(135%);
}

body:not(:has(.qc-portal)) [class*="rounded-xl"][class*="border"],
body:not(:has(.qc-portal)) [class*="rounded-2xl"][class*="border"] {
  border-color: var(--border);
}

.erp-table {
  overflow: hidden;
  border-radius: .75rem;
}

.erp-table thead th {
  color: var(--text-secondary);
  font-size: .72rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.erp-input:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline-color: var(--ring);
}

/* Public frontend: same visual language as the Lovable reference. */
.qc-portal {
  --app-bg: #f4f1ea !important;
  --background: #f4f1ea !important;
  --surface: #ffffff !important;
  --primary: #012a20 !important;
  --primary-hover: #064638 !important;
  --secondary: #187f78 !important;
  --accent: #d6b56d !important;
  --text-main: #17362e !important;
  --text-secondary: #50675f !important;
  --border: rgba(1, 42, 32, .11) !important;
  --ring: #187f78 !important;
  --gold: #d6b56d !important;

  --ft-bg: #f4f1ea !important;
  --ft-bg-secondary: #f8f6f0 !important;
  --ft-card: #ffffff !important;
  --ft-header: #012a20 !important;
  --ft-footer: #012a20 !important;
  --ft-primary: #012a20 !important;
  --ft-secondary: #187f78 !important;
  --ft-accent: #d6b56d !important;
  --ft-text: #17362e !important;
  --ft-text-secondary: #50675f !important;
  --ft-border: rgba(1, 42, 32, .11) !important;
  --ft-heading-font: "Plus Jakarta Sans", "Inter", sans-serif !important;
  --ft-body-font: "Inter", ui-sans-serif, system-ui, sans-serif !important;
  --ft-card-radius: 1rem !important;
  --ft-card-shadow: 0 2px 4px rgba(1, 42, 32, .06), 0 18px 44px -24px rgba(1, 42, 32, .28) !important;

  --qc-bg: #f4f1ea !important;
  --qc-bg-soft: #f8f6f0 !important;
  --qc-mint: #edf6f1 !important;
  --qc-peach: #f8f1e5 !important;
  --qc-surface: #ffffff !important;
  --qc-surface-raised: #ffffff !important;
  --qc-surface-hover: #eef5f1 !important;
  --qc-primary: #012a20 !important;
  --qc-primary-hover: #064638 !important;
  --qc-primary-soft: rgba(1, 42, 32, .09) !important;
  --qc-cyan: #187f78 !important;
  --qc-lime: #d6b56d !important;
  --qc-gold: #d6b56d !important;
  --qc-charcoal: #17362e !important;
  --qc-text: #17362e !important;
  --qc-text-secondary: #50675f !important;
  --qc-text-muted: #6f817a !important;
  --qc-border: rgba(1, 42, 32, .11) !important;
  --qc-border-strong: rgba(1, 42, 32, .2) !important;

  background: #f4f1ea !important;
  color: #17362e !important;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif !important;
}

.qc-portal > div:nth-of-type(2) {
  background: #d6b56d !important;
  color: #012a20 !important;
}

.qc-portal > header {
  background: rgba(1, 42, 32, .96) !important;
  border-color: rgba(214, 181, 109, .18) !important;
  color: #f8f6f0 !important;
  backdrop-filter: blur(14px) saturate(130%);
}

.qc-portal > header a,
.qc-portal > header button,
.qc-portal > header [class*="text-"] {
  color: #f8f6f0 !important;
}

.qc-portal > header .qc-nav-link:hover,
.qc-portal > header .qc-nav-link[data-active="true"] {
  color: #d6b56d !important;
}

.qc-portal section:first-of-type > .absolute > .absolute {
  background: linear-gradient(112deg, #012a20 0%, #064638 58%, #187f78 100%) !important;
}

.qc-portal section:first-of-type h1,
.qc-portal section:first-of-type h2,
.qc-portal section:first-of-type p {
  color: #f8f6f0 !important;
}

.qc-portal section:first-of-type p:first-child {
  color: #d6b56d !important;
}

.qc-portal section:first-of-type p:not(:first-child) {
  color: #c7d6cf !important;
}

.qc-portal section:first-of-type .ft-btn {
  background: #187f78 !important;
  color: #ffffff !important;
  border-radius: .65rem !important;
}

.qc-portal section:first-of-type .ft-btn:hover {
  background: #22958c !important;
}

.qc-portal section:first-of-type .ft-btn-secondary {
  color: #f8f6f0 !important;
  border-color: rgba(248, 246, 240, .42) !important;
  border-radius: .65rem !important;
}

.qc-portal .ft-card {
  border-color: rgba(1, 42, 32, .11) !important;
  border-radius: 1rem !important;
}

.qc-portal footer {
  background: #012a20 !important;
  border-color: rgba(214, 181, 109, .18) !important;
  color: #e9ede9 !important;
}

.qc-portal footer p,
.qc-portal footer a,
.qc-portal footer li {
  color: inherit !important;
}

@media (max-width: 767px) {
  [data-sidebar="menu-button"][data-active="true"] {
    box-shadow: inset 3px 0 0 var(--sidebar-primary);
  }

  .qc-portal section:first-of-type {
    min-height: 72vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-sidebar="menu-button"] {
    transition: none;
  }
}
