/* =========================================
   INVENTRA — Global Styles
   static/css/style.css
   ========================================= */

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

:root {
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --border:    #e0e0e5;
  --text:      #1d1d1f;
  --muted:     #86868b;
  --accent:    #1d1d1f;
  --accent-hover: #3a3a3c;
  --danger:    #d93025;
  --success:   #1a7f37;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 18px; }

p {
  line-height: 1.6;
  color: var(--muted);
}

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

a:hover {
  text-decoration: underline;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

/* ---- Form elements ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(29,29,31,0.08);
  background: var(--surface);
}

input::placeholder {
  color: #b0b0b5;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(217,48,37,0.3);
}

.btn-danger:hover {
  background: rgba(217,48,37,0.06);
}

.btn-full { width: 100%; }

/* ---- Alerts / Messages ---- */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.alert-error {
  background: rgba(217,48,37,0.08);
  border: 1px solid rgba(217,48,37,0.2);
  color: var(--danger);
}

.alert-success {
  background: rgba(26,127,55,0.08);
  border: 1px solid rgba(26,127,55,0.2);
  color: var(--success);
}

.alert.show { display: block; }

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,245,247,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user {
  font-size: 13px;
  color: var(--muted);
}

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

tbody tr:hover {
  background: #fafafa;
}

td[contenteditable="true"] {
  outline: none;
  border-radius: 4px;
  transition: background 0.15s;
}

td[contenteditable="true"]:focus {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* ---- Page layout ---- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---- Auth layout ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.auth-logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  display: block;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--text);
  font-weight: 500;
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---- Fade in animation ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.4s ease forwards;
}
