/* assets/style.css — estilos del panel y páginas públicas */

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
    background: #f3f4f6;
    line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
}
pre {
    background: #111827; color: #e5e7eb;
    padding: 16px; border-radius: 8px;
    overflow-x: auto; font-size: 0.85em;
}
pre code { background: transparent; color: inherit; padding: 0; }

/* Topbar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px;
    background: #111827; color: #fff;
    flex-wrap: wrap; gap: 12px;
}
.topbar .brand { font-weight: 700; font-size: 1.05em; letter-spacing: 0.2px; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
    color: #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.92em;
}
.topbar nav a:hover { background: #1f2937; color: #fff; text-decoration: none; }
.topbar nav a.active { background: #2563eb; color: #fff; }
.topbar nav a.logout { color: #fca5a5; }
.topbar nav a.logout:hover { background: #7f1d1d; color: #fff; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
h1 { margin: 0 0 16px; font-size: 1.6em; }
h2 { margin-top: 28px; font-size: 1.2em; }
h4 { margin: 16px 0 6px; color: #374151; }

/* Stats cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-label { color: #6b7280; font-size: 0.85em; }
.stat-value { font-size: 1.9em; font-weight: 700; margin-top: 4px; color: #111827; }

/* Two-column grid */
.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .grid-two { grid-template-columns: 1fr; }
}
section {
    background: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
section h2 { margin-top: 0; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9em;
    vertical-align: middle;
}
th { background: #f9fafb; color: #374151; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.small {
    font-size: 0.75em; color: #6b7280;
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
td.actions { white-space: nowrap; }
.text-danger, td.text-danger { color: #dc2626; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 2px;
}
.badge.green { background: #d1fae5; color: #065f46; }
.badge.gray  { background: #e5e7eb; color: #374151; }
.badge.red   { background: #fee2e2; color: #991b1b; }

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 14px;
    background: #e5e7eb;
    color: #111827;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
    text-decoration: none;
}
.btn:hover { background: #d1d5db; text-decoration: none; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.small { padding: 4px 10px; font-size: 0.8em; }

/* Forms */
.form {
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: grid;
    gap: 14px;
    max-width: 560px;
}
.form label {
    display: flex; flex-direction: column;
    gap: 4px; font-weight: 500; font-size: 0.9em;
}
.form input, .form select {
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    background: #fff;
}
.form input:focus, .form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92em;
}
.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.alert.info {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}
.alert .token-box {
    margin: 10px 0;
    background: #064e3b;
    color: #d1fae5;
    padding: 12px 14px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9em;
}

.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.danger:hover { background: #fecaca; }

code.token {
    font-size: 0.8em;
    background: #eef2ff;
    color: #3730a3;
    word-break: break-all;
    white-space: normal;
    display: inline-block;
    max-width: 340px;
}

.muted { color: #6b7280; }

/* Login */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    padding: 16px;
}
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.login-card h1 { margin: 0 0 4px; font-size: 1.4em; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }
.login-card label {
    display: flex; flex-direction: column;
    gap: 4px; font-weight: 500; font-size: 0.9em;
}
.login-card input {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}
.login-card input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* API Docs */
.method {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}
.method.get  { background: #10b981; }
.method.post { background: #f59e0b; }
