/* ORMdoo Platform — CSS */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --accent: #6366f1;
  --accent-hover: #4f52d4;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --radius: 8px;
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.6; min-height: 100vh; }

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

/* Layout auth */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 400px; }
.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 2rem; }
.brand-dot { width: 32px; height: 32px; background: var(--accent); border-radius: 8px; }
.brand-name { font-size: 1.25rem; font-weight: 700; }
.brand-sub { font-size: .75rem; color: var(--muted); }

/* Layout app */
.app-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: .25rem; flex-shrink: 0; }
.sidebar .brand { margin-bottom: 1.5rem; }
.nav-link { display: block; padding: .5rem .75rem; border-radius: 6px; color: var(--muted); font-size: .875rem; transition: background .15s, color .15s; }
.nav-link:hover, .nav-link.active { background: var(--border); color: var(--text); text-decoration: none; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
.main { flex: 1; padding: 2rem; overflow-x: auto; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 600; }
.page-header p { color: var(--muted); margin-top: .25rem; }

/* Forms */
label { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: .35rem; margin-top: 1rem; }
label:first-child { margin-top: 0; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: .6rem .75rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: .875rem; outline: none; transition: border-color .15s;
}
input:focus { border-color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: 6px; font-size: .875rem; font-weight: 500; cursor: pointer; border: none; transition: background .15s, opacity .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-block { width: 100%; justify-content: center; margin-top: 1.25rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* Instance card */
.instance-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.instance-name { font-weight: 600; margin-bottom: .25rem; }
.instance-domain { font-size: .8rem; color: var(--muted); margin-bottom: .75rem; }
.instance-actions { display: flex; gap: .5rem; margin-top: .75rem; }

/* Status badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-running  { background: rgba(16,185,129,.15); color: #6ee7b7; }
.badge-stopped  { background: rgba(148,163,184,.12); color: var(--muted); }
.badge-provisioning { background: rgba(99,102,241,.15); color: #a5b4fc; }
.badge-error    { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-active   { background: rgba(16,185,129,.15); color: #6ee7b7; }
.badge-suspended { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-pending_payment { background: rgba(148,163,184,.12); color: var(--muted); }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: .6rem .75rem; font-size: .75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); font-size: .875rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Empty state */
.empty { text-align: center; padding: 3rem; color: var(--muted); }
.empty-icon { font-size: 2rem; margin-bottom: .75rem; }
