:root {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --accent-strong: #0891b2;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border-subtle: #334155;
    --danger: #ef4444;
    --radius-lg: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.6);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
    color: var(--text-main);
}

/* ---------------- Layout ---------------- */

.app-shell {
    max-width: 1024px;
    margin: 40px auto;
    padding: 0 20px;
}

.app-card {
    background: #020617;
    border-radius: 24px;
    padding: 24px 28px 28px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* ---------------- Header ---------------- */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 16px;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-main);
}

.app-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------------- Nav ---------------- */

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.button-link {
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.6);
    color: var(--accent);
}

/* ---------------- Badges ---------------- */

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(56, 189, 248, 0.08);
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* ---------------- Forms ---------------- */

.form-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: #020617;
    color: var(--text-main);
    font-size: 0.9rem;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

/* ---------------- Buttons ---------------- */

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

button,
.button-link {
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #020617;
    font-weight: 600;
    border: none;
}

.btn-ghost {
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.btn-danger {
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.7);
}

button:hover,
.button-link:hover {
    filter: brightness(1.05);
}

/* ---------------- Alerts ---------------- */

.alert-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(248, 113, 113, 0.6);
    background: rgba(153, 27, 27, 0.35);
    color: #fecaca;
    font-size: 0.85rem;
}

/* ---------------- Tables ---------------- */

.table-wrapper {
    margin-top: 16px;
    overflow-x: auto;
    overflow-y: hidden;
}


table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-main);
}

thead {
    background: rgba(15, 23, 42, 0.95);
}

th,
td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
     vertical-align: top;
}

th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
}

tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.55);
}

tbody tr:hover {
    background: rgba(15, 23, 42, 0.85);
}

table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

table a:hover {
    text-decoration: underline;
}

/* ---------------- Auth ---------------- */

.auth-shell {
    max-width: 420px;
    margin: 80px auto;
    padding: 0 20px;
}

.auth-card {
    background: #020617;
    border-radius: 24px;
    padding: 26px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.auth-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Layout container used by layout_top.php */
.content-shell {
    max-width: 1024px;
    margin: 40px auto;
    padding: 0 20px;
}
/* Table column behavior */

.col-nowrap {
    white-space: nowrap;
}

.col-wrap {
    white-space: normal;
    word-break: break-word;
    max-width: 480px;
}
/* Data table border */
.table-wrapper table {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
}
.table-wrapper table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

.table-wrapper table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}


