/* ============================================================
   NexoERP — Base CSS
   Apple.com Design Language — valores exatos do apple.com
   ============================================================ */

:root {
  /* ── Cores — Light (apple.com exato) ── */
  --bg:          #fbfbfd;   /* page bg exato do apple.com */
  --bg-surface:  #ffffff;
  --bg-subtle:   #f5f5f7;   /* gray sections do apple.com */
  --bg-hover:    #e8e8ed;

  --text-primary:   #1d1d1f;  /* apple.com --color-label-primary   */
  --text-secondary: #6e6e73;  /* apple.com --color-label-secondary  */
  --text-tertiary:  #86868b;  /* apple.com --color-label-tertiary   */
  --text-inverse:   #ffffff;

  /* zero border por padrão — apple usa fundo diferente p/ separar */
  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);

  /* apple blue — idêntico ao apple.com */
  --accent:        #0071e3;
  --accent-hover:  #0077ed;
  --accent-light:  rgba(0, 113, 227, 0.10);

  --success:    #1c7c3f;   --success-bg: #eaf6ef;
  --warning:    #9a5b0a;   --warning-bg: #fef4e4;
  --danger:     #cf2a2a;   --danger-bg:  #fde8e8;
  --info:       #0071e3;   --info-bg:    #e5f0ff;

  --primary:    var(--accent);
  --error:      var(--danger);
  --text-muted: var(--text-secondary);
  --surface:    var(--bg-surface);

  --sidebar-w: 60px;
  --topbar-h:  52px;

  /* apple usa border-radius generosos */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;   /* cards */
  --radius-xl:   24px;   /* modals */
  --radius-pill: 980px;  /* botões — o pill shape icônico da Apple */

  /* sombras — apple usa sombras muito sutis */
  --shadow-sm: 0 2px 8px  rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0, 0, 0, 0.06);

  /* SF Pro — sistema Apple */
  --font:         -apple-system, BlinkMacSystemFont, "SF Pro Text",    "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "SF Mono", "Cascadia Code", "Fira Code", monospace;

  /* glass — nav do apple.com exato */
  --glass:        rgba(255, 255, 255, 0.72);
  --glass-dark:   rgba(22,  22,  23,  0.78);

  /* transições — apple usa cubic-bezier suave */
  --transition:        0.2s  cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.3s  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark mode — macOS dark palette ── */
[data-theme="dark"] {
  --bg:          #000000;   /* macOS dark — preto puro */
  --bg-surface:  #1c1c1e;
  --bg-subtle:   #2c2c2e;
  --bg-hover:    #3a3a3c;

  --text-primary:   #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary:  #6e6e73;
  --text-inverse:   #000000;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  --accent:       #2997ff;   /* apple blue para dark */
  --accent-hover: #409cff;
  --accent-light: rgba(41, 151, 255, 0.14);

  --success:    #30d158;   --success-bg: #0a2318;
  --warning:    #ffd60a;   --warning-bg: #1f1509;
  --danger:     #ff453a;   --danger-bg:  #200d0d;
  --info:       #2997ff;   --info-bg:    #0c1829;

  --glass: rgba(22, 22, 23, 0.78);
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.47059;   /* line-height ratio do apple.com */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Scrollbar — macOS style */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }

/* Tipografia — SF Pro Display scaling */
h1 { font-family: var(--font-display); font-size: 1.4rem;  font-weight: 700; letter-spacing: -0.025em; }
h2 { font-family: var(--font-display); font-size: 1.17rem; font-weight: 600; letter-spacing: -0.020em; }
h3 { font-family: var(--font-display); font-size: 1.03rem; font-weight: 600; letter-spacing: -0.015em; }

::selection { background: var(--accent); color: #fff; }
