/* ==========================================================================
   TAC (Talend Administration Center) look & feel
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font: 11px/1.35 Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
    color: #333;
    background: #fff;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 1px dotted #15428b; outline-offset: 1px; }

svg.ico { width: 14px; height: 14px; flex: 0 0 auto; vertical-align: middle; }

/* ---- License banner ----------------------------------------------------- */
.license-banner {
    flex: 0 0 auto;
    padding: 2px 10px;
    background: #f2e5c6;
    border-bottom: 1px solid #dac99c;
    color: #6f4c10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- App layout --------------------------------------------------------- */
.app { flex: 1 1 auto; display: flex; min-height: 0; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; padding: 0;
    border: 1px solid transparent; border-radius: 2px;
    background: transparent; color: #666; font-size: 13px; line-height: 1;
}
.icon-btn:hover { border-color: #b8b8b8; background: linear-gradient(#fff, #e6e6e6); color: #222; }

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar {
    flex: 0 0 245px;
    width: 245px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f6f6f6;
    border-right: 1px solid #c3c3c3;
}

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    height: 26px; padding: 0 4px 0 6px;
    border-bottom: 1px solid #d3d3d3;
    background: linear-gradient(#fdfdfd, #ececec);
}
.sidebar-title { font-size: 14px; color: #7a7a7a; }

.menu-tree { flex: 1 1 auto; overflow: auto; padding: 3px 0; }
.menu-tree ul { list-style: none; margin: 0; padding: 0; }

.tree-row {
    display: flex; align-items: center; gap: 3px;
    width: 100%; height: 18px; padding: 0 4px;
    border: 1px solid transparent; background: transparent;
    text-align: left; white-space: nowrap; color: #222;
}
.tree-row:hover { background: #e7edf6; }
.tree-row.selected { background: #dcdfe4; border-color: #c7ccd4; }
.tree-row .ico { color: #444; }
.tree-leaf > .tree-row { padding-left: 17px; }
.tree-root-leaf > .tree-row { padding-left: 4px; }
.tree-leaf .tree-label { color: #1f2f4a; }

.tree-toggle { position: relative; width: 9px; height: 9px; flex: 0 0 9px; }
.tree-toggle::before {
    content: ""; position: absolute; left: 1px; top: 1px;
    border-style: solid; border-width: 3.5px 0 3.5px 5px;
    border-color: transparent transparent transparent #666;
    transition: transform .12s;
}
.tree-group[aria-expanded="true"] .tree-toggle::before {
    transform: rotate(45deg);
    border-left-color: #444;
}

/* sidebar footer */
.sidebar-footer { padding: 6px 8px 3px; border-top: 1px solid #d6d6d6; }
.user-name { font-size: 12px; font-weight: bold; color: #1b3a63; word-break: break-all; }
.user-roles { font-size: 9px; font-style: italic; color: #444; margin-top: 1px; }
.server-time { font-size: 10px; color: #333; margin: 2px 0 8px; }
.server-time span { margin-left: 2px; }

.user-actions { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; padding-left: 4px; }
.user-actions .btn { min-width: 64px; }

.lang-select {
    position: relative; display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 4px; border-radius: 2px;
}
.lang-select .flag { width: 18px; height: 10px; }
.lang-select select {
    height: 22px; border: 0; background: transparent; color: #fff; cursor: pointer;
}
.lang-select select option { color: #333; background: #fff; }

.version { font-size: 9px; font-style: italic; font-weight: bold; color: #1b3a63; }
.node-id { font-size: 9px; color: #444; }

/* collapsed menu */
body.menu-collapsed .sidebar { flex-basis: 24px; width: 24px; }
body.menu-collapsed .sidebar-title,
body.menu-collapsed .menu-tree,
body.menu-collapsed .sidebar-footer { display: none; }
body.menu-collapsed .sidebar-header { justify-content: center; padding: 0; }

/* ---- Workspace ---------------------------------------------------------- */
.workspace { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

.page-header {
    flex: 0 0 26px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 8px;
    border-bottom: 1px solid #c3c3c3;
    background: #fff;
}
.page-header h1 { margin: 0; font-size: 15px; font-weight: bold; color: #333; letter-spacing: .2px; }

.brand { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand-product { font: bold 17px/1 Arial, Helvetica, sans-serif; color: #2a2a2a; letter-spacing: -.3px; }
.brand-edition { font: 14px/1 Arial, Helvetica, sans-serif; color: #3a3a3a; margin-right: 16px; }
.brand-partner { font: bold 17px/1 Arial, Helvetica, sans-serif; color: #4d4d4d; }
.brand-partner::first-letter { color: #009845; }

.page-host { flex: 1 1 auto; position: relative; min-height: 0; }
.page { position: absolute; inset: 0; display: flex; min-width: 0; }

.empty-page { padding: 14px; color: #999; font-style: italic; }

/* ---- Bottom tabs -------------------------------------------------------- */
.bottom-tabs {
    flex: 0 0 23px;
    border-top: 1px solid #c3c3c3;
    background: linear-gradient(#f1f1f1, #e2e2e2);
    overflow-x: auto; overflow-y: hidden;
}
.bottom-tabs-list { display: flex; height: 100%; padding-left: 4px; }

.btab {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 0 6px 0 2px;
    border: 1px solid transparent; border-top: 0;
    white-space: nowrap;
}
.btab + .btab { border-left: 1px solid #cfcfcf; }
.btab.active {
    background: #fff;
    border-color: #b9b9b9;
    border-top: 0;
    margin-top: -1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.btab-label {
    display: inline-flex; align-items: center; gap: 5px;
    height: 20px; padding: 0 8px;
    border: 0; background: transparent; color: #333;
}
.btab-close {
    width: 14px; height: 14px; padding: 0;
    border: 0; border-radius: 2px; background: transparent;
    color: #999; font-size: 12px; line-height: 14px;
}
.btab-close:hover { background: #d7d7d7; color: #333; }
.badge {
    display: inline-block; min-width: 13px; padding: 0 3px;
    border-radius: 2px; background: #d8261c; color: #fff;
    font-size: 9px; font-weight: bold; line-height: 13px; text-align: center;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 25px; min-width: 76px; padding: 0 12px;
    border-radius: 2px;
}
.btn-green { background: #18893b; border: 1px solid #0f6d2c; color: #fff; }
.btn-green:hover:not(:disabled) { background: #1f9c46; }
.btn-green:active:not(:disabled) { background: #13742f; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .ico-save { color: #ffd6d6; }
.btn-default { background: linear-gradient(#fff, #e4e4e4); border: 1px solid #aaa; color: #333; }
.btn-default:hover { background: linear-gradient(#fff, #d9d9d9); }

/* ---- Projects page ------------------------------------------------------ */
.grid-panel { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

.toolbar {
    position: relative;
    flex: 0 0 25px;
    display: flex; align-items: center; gap: 2px;
    padding: 0 4px;
    background: linear-gradient(#f8f8f8, #e1e1e1);
    border-bottom: 1px solid #c3c3c3;
}
.tb-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 21px; padding: 0 6px;
    border: 1px solid transparent; border-radius: 2px; background: transparent; color: #333;
}
.tb-btn:hover:not(:disabled) { border-color: #b5b5b5; background: linear-gradient(#fff, #e3e3e3); }
.tb-btn:disabled { opacity: .45; cursor: default; }
.tb-btn .ico { color: #555; }
.tb-btn[data-action="delete"] .ico { color: #c0392b; }
.tb-spacer { flex: 1 1 auto; }
.tb-status { color: #2d7a3e; margin-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-status.error { color: #c0392b; }

.col-menu {
    position: absolute; right: 4px; top: 24px; z-index: 20;
    min-width: 160px; padding: 3px 0;
    background: #fff; border: 1px solid #a9adbc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, .18);
}
.col-menu-title { padding: 3px 10px 4px; color: #777; border-bottom: 1px solid #eee; margin-bottom: 2px; }
.col-menu label { display: flex; align-items: center; gap: 6px; padding: 3px 10px; cursor: pointer; }
.col-menu label:hover { background: #e7edf6; }

.grid-wrap { flex: 1 1 auto; overflow: auto; position: relative; }

.grid { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.grid th {
    position: sticky; top: 0; z-index: 1;
    height: 20px; padding: 0 5px;
    background: linear-gradient(#fbfbfb, #e9e9e9);
    border-bottom: 1px solid #c3c3c3; border-right: 1px solid #d5d5d5;
    font-weight: normal; text-align: left; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    user-select: none; cursor: pointer;
}
.grid th:hover { background: linear-gradient(#fff, #dfe6ef); }
.grid th .sort-ind { color: #777; font-size: 8px; margin-left: 3px; }
.grid td {
    height: 22px; padding: 0 5px;
    border-bottom: 1px solid #f3f3f3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid tbody tr { cursor: default; outline: none; }
.grid tbody tr:hover td { background: #eef3fa; }
.grid tbody tr.selected td { background: #dbe6f5; border-bottom-color: #c9d8ee; }
.grid tbody tr:focus-visible td { box-shadow: inset 0 1px 0 #8fb0dc, inset 0 -1px 0 #8fb0dc; }
.grid .c-center { text-align: center; }

.cell-icon { display: inline-flex; vertical-align: middle; }
.cell-icon svg { width: 15px; height: 15px; }
.ic-active { color: #2f9c47; }
.ic-inactive { color: #bbb; }
.ic-type { color: #555; }
.ic-git { color: #2b2b2b; }
.ic-none { color: #aaa; }

.grid-empty { padding: 10px; color: #888; }

/* detail panel */
.detail-panel {
    flex: 0 0 300px; width: 300px;
    display: flex; flex-direction: column;
    border-left: 1px solid #c3c3c3; background: #fff;
    min-height: 0;
}
.detail-top { flex: 0 0 25px; display: flex; align-items: center; justify-content: flex-end; padding: 0 3px; }
.detail-panel.collapsed { flex-basis: 24px; width: 24px; }
.detail-panel.collapsed .detail-form { display: none; }
.detail-panel.collapsed .detail-top { justify-content: center; }

.detail-form { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.detail-body { flex: 1 1 auto; overflow: auto; padding: 0 10px 10px 12px; }
.detail-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.detail-title { padding: 6px 0 8px; font-weight: bold; color: #333; }

.form-row { display: flex; align-items: center; min-height: 24px; }
.form-row > .lbl { flex: 0 0 88px; color: #333; }
.field { display: flex; align-items: center; gap: 3px; min-width: 0; }

.field input[type="text"],
.field select {
    width: 154px; height: 19px;
    padding: 1px 3px;
    border: 1px solid #b5b8c8; border-radius: 0;
    background: #fff;
}
.field select { padding: 0 1px; }
.field input[readonly] { color: #9a9a9a; background: #fbfbfb; }
.field input:focus, .field select:focus { border-color: #7eadd9; outline: none; }
.field .invalid,
.field .invalid:focus { border-color: #e0201b; }
.field input[type="checkbox"] { margin: 0 0 0 1px; }

.radio-group { display: flex; align-items: center; gap: 12px; }
.radio-group label { display: inline-flex; align-items: center; gap: 4px; }
.radio-group input { margin: 0; }

.check-row { gap: 6px; padding-top: 2px; }
.check-row label { display: inline-flex; align-items: center; gap: 6px; }
.check-row input { margin: 0; }

.err-icon {
    position: relative; display: inline-block;
    width: 10px; height: 10px; margin-left: 4px; flex: 0 0 10px;
    border: 1.5px solid #e0201b; background: #fff;
    transform: rotate(45deg);
    cursor: help;
}
.err-icon::after {
    content: "!";
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    transform: rotate(-45deg);
    color: #e0201b; font: bold 8px/1 Arial, sans-serif;
}

.detail-actions {
    flex: 0 0 auto;
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 10px 14px 10px;
}

/* ---- Dialog ------------------------------------------------------------- */
.tac-dialog {
    min-width: 320px; max-width: 460px; padding: 0;
    border: 1px solid #99bbe8; border-radius: 3px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, .3);
    font: inherit; color: #333;
}
.tac-dialog::backdrop { background: rgba(200, 200, 200, .45); }
.tac-dialog-title {
    padding: 5px 8px;
    background: linear-gradient(#dae7f6, #c4d8f0);
    border-bottom: 1px solid #99bbe8;
    font-weight: bold; color: #15428b;
}
.tac-dialog-body { display: flex; gap: 10px; align-items: flex-start; padding: 14px 12px; white-space: pre-line; }
.tac-dialog-body .ico { width: 26px; height: 26px; }
.tac-dialog-body .ico-question { color: #2d6cb5; }
.tac-dialog-body .ico-error { color: #c0392b; }
.tac-dialog-body .ico-info { color: #2d6cb5; }
.tac-dialog-actions { display: flex; justify-content: center; gap: 8px; padding: 0 12px 12px; }
.tac-dialog-actions .btn { min-width: 70px; height: 22px; }

/* ---- User settings page ------------------------------------------------- */
.settings-page { flex: 1 1 auto; min-width: 0; }
.settings-scroll { flex: 1 1 auto; width: 100%; overflow: auto; padding: 0; }
.settings-form { max-width: 560px; padding: 0 0 20px; }

.settings-panel {
    padding: 12px 16px 14px;
    border-bottom: 1px solid #eee;
    background: #fbfbfb;
}
.settings-heading {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}
.settings-hint { margin: 6px 0 0 150px; color: #999; font-style: italic; }

.settings-form .form-row { min-height: 27px; margin-bottom: 6px; }
.settings-form .lbl2 {
    flex: 0 0 150px;
    padding-right: 8px;
    color: #2f6ca3;
}
.settings-form .field input[type="text"],
.settings-form .field input[type="password"] {
    width: 190px; height: 20px;
    padding: 1px 4px;
    border: 1px solid #b5b8c8; border-radius: 0;
    background: #fff;
}
.settings-form .field input:focus { border-color: #7eadd9; outline: none; }
.settings-form .field .invalid,
.settings-form .field .invalid:focus { border-color: #e0201b; background: #fff6f6; }

.pw-meter {
    width: 260px; height: 6px;
    background: #e6e6e6;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    overflow: hidden;
}
.pw-meter-bar {
    display: block; width: 0; height: 100%;
    background: #ddd;
    transition: width .15s, background .15s;
}

.settings-actions {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px 0;
}
.settings-actions .btn { min-width: 84px; height: 24px; }
.settings-status { color: #2d7a3e; }
.settings-status.error { color: #c0392b; }

/* ---- Users / User groups pages ------------------------------------------ */
.tb-sep {
    width: 1px; height: 16px; margin: 0 4px;
    background: #c9c9c9;
}

/* Role group header rows in the Users grid */
.users-grid tbody tr.role-group td {
    background: #eef1f5;
    border-bottom: 1px solid #d7dce3;
    border-top: 1px solid #d7dce3;
    padding: 2px 6px;
    cursor: default;
}
.users-grid tbody tr.role-group:hover td { background: #eef1f5; }
.users-grid tbody tr.role-group .ico { color: #5a6b86; vertical-align: middle; }
.role-group-label { font-weight: bold; color: #33475f; margin-left: 4px; }
.users-grid .c-login { color: #1f4e79; }

/* Wider detail panel for the Users form */
.detail-panel-wide { flex-basis: 320px; width: 320px; }
.detail-panel-wide.collapsed { flex-basis: 24px; width: 24px; }
.users-page .detail-form .field input[type="text"],
.users-page .detail-form .field input[type="password"],
.users-page .detail-form .field select { width: 168px; }
.users-page .detail-form .lbl { flex-basis: 92px; }
.users-page .settings-hint { margin: 6px 0 0; padding-left: 92px; color: #999; font-style: italic; }

/* ---- Project authorizations page ---------------------------------------- */
.authz-page { flex: 1 1 auto; min-width: 0; }
.authz-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.authz-toolbar {
    flex: 0 0 25px;
    display: flex; align-items: center; gap: 2px;
    padding: 0 4px;
    background: linear-gradient(#f8f8f8, #e1e1e1);
    border-bottom: 1px solid #c3c3c3;
}
.authz-hint { margin: 6px 10px; color: #555; }
.authz-hint b { color: #333; }

.authz-modes {
    display: flex; justify-content: center; gap: 0;
    margin: 2px 0 8px;
}
.authz-mode {
    height: 22px; padding: 0 14px;
    border: 1px solid #b7b7b7; background: linear-gradient(#fff, #eee); color: #444;
}
.authz-mode + .authz-mode { border-left: 0; }
.authz-mode:first-child { border-radius: 2px 0 0 2px; }
.authz-mode:last-child { border-radius: 0 2px 2px 0; }
.authz-mode.active { background: linear-gradient(#e9e9e9, #d7d7d7); color: #222; font-weight: bold; box-shadow: inset 0 1px 2px rgba(0,0,0,.15); }

.authz-split { flex: 1 1 auto; display: flex; min-height: 0; border-top: 1px solid #dcdcdc; }
.authz-pane { flex: 1 1 50%; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.authz-left { border-right: 1px solid #d3d3d3; }
.authz-pane-title { flex: 0 0 auto; margin: 0; padding: 5px 10px 4px; font-size: 13px; font-weight: normal; color: #6a6a6a; }
.authz-pane .grid-wrap { flex: 1 1 auto; overflow: auto; }

.authz-grid tbody tr[data-key] { cursor: pointer; }
.authz-grid .c-label { color: #1f4e79; }
.authz-counts { white-space: nowrap; }
.authz-count { display: inline-flex; align-items: center; gap: 3px; margin: 0 6px; color: #333; }
.authz-count .count-ico .ico,
.authz-count-head .count-ico .ico { width: 13px; height: 13px; color: #5a6b86; }
.authz-count-head { display: inline-flex; gap: 8px; }

.right-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 18px; padding: 0;
    border: 1px solid transparent; border-radius: 2px; background: transparent;
}
.right-btn:hover { border-color: #b8b8b8; background: linear-gradient(#fff, #eee); }
.right-btn .ico { width: 15px; height: 15px; }
.right-btn.rt-none  .ico { color: #c0392b; }
.right-btn.rt-read  .ico { color: #2f9c47; }
.right-btn.rt-write .ico { color: #2f6ca3; }
.right-btn.rt-owner .ico { color: #b8860b; }
.right-btn:disabled { opacity: .5; }

.authz-status { flex: 0 0 auto; padding: 3px 10px; color: #2d7a3e; min-height: 18px; }
.authz-status.error { color: #c0392b; }

/* ---- Locks page --------------------------------------------------------- */
.locks-page { flex: 1 1 auto; min-width: 0; }
.locks-grid .c-locked-item { color: #1f4e79; }
.locks-grid tbody tr[data-id] { cursor: pointer; }
