/*
    Toolbox CSS Styles — admin rail + section content.
    See __devel/_archive/design_handoff_ui_redesign/README.md and public/css/tokens.css.
*/

/* ---------- Shell / rail ---------- */

.toolbox-shell {
    display: flex;
    height: 100vh;
    width: 100%;
    background: var(--bg-page);
    font-family: var(--font-body);
}

.toolbox-rail {
    width: 72px;
    flex: 0 0 72px;
    background: var(--rail-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    gap: 8px;
}

.toolbox-rail-logo {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.toolbox-rail-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-rail);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    flex: 0 0 auto;
    text-decoration: none;
}

.toolbox-rail-btn .icon-btn {
    width: 20px;
    height: 20px;
    background-color: rgba(43, 43, 40, .5);
}

.toolbox-rail-btn:hover {
    background: var(--neutral-fill);
}

.toolbox-rail-btn.active {
    background: var(--neutral-fill);
}

.toolbox-rail-btn.active .icon-btn {
    background-color: var(--accent-clay);
}

.toolbox-rail-spacer {
    flex: 1;
}

/* ---------- Content column / header ---------- */

.toolbox-content-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.toolbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-header);
}

.toolbox-header-title {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbox-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbox-header-username {
    font-size: 12px;
    color: var(--text-secondary-muted);
}

/* Shared .user-menu-trigger / .avatar-chip / .user-menu / .user-menu-item /
   .user-menu-divider classes live in main-styles.css — reused by the gym
   layout's header menu too. */

.toolbox-content {
    padding: 28px 32px;
    max-width: 1200px;
}

.toolbox-content-loading {
    color: var(--text-secondary-muted);
    font-size: 13px;
}

.tool-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* ---------- Overview: stat tiles ---------- */

.toolbox-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.toolbox-stat-tile {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-tile);
    padding: 14px 16px;
    background: var(--surface-card);
}

.toolbox-stat-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-label);
    font-weight: 600;
}

.toolbox-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

/* ---------- Section label ---------- */

.toolbox-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-label);
    margin-bottom: 8px;
}

/* ---------- Generic bordered/rounded table (div-grid rows) ---------- */

.toolbox-table {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-tile);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--surface-header);
}

.toolbox-table-row {
    display: grid;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    align-items: center;
    border-top: 1px solid var(--border-row);
}

.toolbox-table-row:first-child {
    border-top: none;
}

.toolbox-table-head {
    background: var(--neutral-fill-strong);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary-muted);
    padding: 9px 16px;
}

.toolbox-overview-table-cols {
    grid-template-columns: 2fr 1fr 1fr 90px;
}

.toolbox-table-action-edit {
    color: var(--accent-sage-link);
    font-weight: 600;
}

.toolbox-table-empty {
    color: var(--text-secondary-muted);
}

.cfg-value {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Buttons / pills ---------- */

.toolbox-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-btn);
    border: none;
    cursor: pointer;
}

.toolbox-btn-clay {
    background: var(--accent-clay);
    color: #fff;
}

.toolbox-btn-neutral {
    background: var(--neutral-fill);
    color: var(--text-primary);
}

.toolbox-action-row {
    display: flex;
    gap: 10px;
}

.tools-justify-end {
    justify-content: flex-end;
}

/* ---------- Ported from manage_gym.css: admin toolbar row ----------
   Used by app/Views/users/index.php and app/Views/users/invites.php,
   which are loaded both as toolbox fragments and as standalone pages. */

.admin-control-row {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.admin-control-row-left,
.admin-control-row-right {
    flex: 1;
}

.admin-control-row-left {
    text-align: left;
}

.admin-control-row-center {
    text-align: center;
}

.admin-control-row-right {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-end;
    gap: 1rem;
}

/* ---------- Bootstrap component reskin, scoped to toolbox fragments ----------
   word_list_manager.php, word_list_generator.php, users/index.php,
   users/invites.php, and manage/settings.php keep their existing Bootstrap
   markup/JS; these rules adopt the design tokens without touching that
   markup, per the handoff's "scope Bootstrap classes as needed" guidance. */

.toolbox-content h2,
.toolbox-content h3,
.toolbox-content h5,
.toolbox-content h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.toolbox-content .table {
    background: var(--surface-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-tile);
    overflow: hidden;
    font-size: 13px;
    color: var(--text-primary);
}

.toolbox-content .table thead th {
    background: var(--neutral-fill-strong);
    color: var(--text-secondary-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border-row);
    padding: 9px 16px;
}

.toolbox-content .table td {
    padding: 10px 16px;
    border-top: 1px solid var(--border-row);
    border-bottom: none;
    vertical-align: middle;
}

.toolbox-content .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: transparent;
    box-shadow: none;
}

.toolbox-content .card {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-tile);
    background: var(--surface-card);
}

.toolbox-content .card-header {
    background: var(--neutral-fill-strong);
    border-bottom: 1px solid var(--border-row);
}

.toolbox-content .btn {
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 13px;
}

.toolbox-content .btn-primary,
.toolbox-content .btn-outline-primary {
    background: var(--accent-clay);
    border-color: var(--accent-clay);
    color: #fff;
}

.toolbox-content .btn-outline-primary:hover {
    background: var(--accent-clay);
    border-color: var(--accent-clay);
    color: #fff;
}

.toolbox-content .btn-secondary,
.toolbox-content .btn-outline-secondary {
    background: var(--neutral-fill);
    border-color: transparent;
    color: var(--text-primary);
}

.toolbox-content .btn-info {
    background: var(--accent-sage-link);
    border-color: var(--accent-sage-link);
    color: #fff;
}

.toolbox-content .form-control,
.toolbox-content .form-select {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-btn);
    font-size: 14px;
}

.toolbox-content .form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary-muted);
}

.bg-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-btn);
}
