*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0b;
  --surface:   #111114;
  --border:    #1f1f24;
  --muted:     #3a3a42;
  --text:      #e8e8ec;
  --subtle:    #7a7a88;
  --accent:    #c8a96e;
  --accent-dim:#8a7048;
  --danger:    #8b3a3a;
  --success:   #2d6a4f;
  --radius:    6px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Layout ---- */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.logo-sub {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subtle);
}

nav a {
  color: var(--subtle);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

nav a:hover { color: var(--text); }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 360px;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo .logo-name {
  font-size: 17px;
  letter-spacing: 0.18em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 20px;
}

/* ---- Forms ---- */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: var(--accent-dim); }

input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--subtle);
}

input[type="file"]::-webkit-file-upload-button {
  background: var(--border);
  border: none;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  margin-right: 10px;
  padding: 4px 10px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 9px 18px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }
.btn-primary  { background: var(--accent);  color: #0a0a0b; }
.btn-sm       { font-size: 12px; padding: 6px 12px; }
.btn-ghost    { background: transparent; border: 1px solid var(--border); color: var(--subtle); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger   { background: var(--danger); color: var(--text); }
.btn-full     { width: 100%; justify-content: center; }

/* ---- Alerts ---- */
.alert {
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 14px;
}

.alert-error   { background: #2a1212; border: 1px solid var(--danger); color: #e07070; }
.alert-success { background: #0e1f18; border: 1px solid var(--success); color: #6fcba3; }

/* ---- Section headings ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* ---- Table ---- */
table {
  border-collapse: collapse;
  width: 100%;
}

th {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #0f0f12; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

/* ---- Client block (admin) ---- */
.client-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.client-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #0e0e11;
}

.client-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.client-username {
  font-size: 12px;
  color: var(--subtle);
  margin-left: 10px;
}

.client-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-files { padding: 0; }

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #0a0a0d;
}

.upload-row input[type="file"] {
  flex: 1;
}

/* ---- Empty state ---- */
.empty {
  color: var(--subtle);
  font-size: 13px;
  padding: 20px 18px;
  font-style: italic;
}

/* ---- File name ---- */
.filename {
  color: var(--text);
  font-size: 13px;
}

.file-meta {
  color: var(--subtle);
  font-size: 12px;
}

/* ---- Grid for admin new client form ---- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }

  /* Client dashboard: hide Size + Date columns so Download button isn't clipped */
  .table-wrap { overflow-x: auto; }
  table th:nth-child(2),
  table th:nth-child(3),
  table td:nth-child(2),
  table td:nth-child(3) { display: none; }
}

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ---- Welcome ---- */
.welcome {
  margin-bottom: 32px;
}

.welcome-name {
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}

.welcome-sub {
  font-size: 13px;
  color: var(--subtle);
}
