/*
 * CRM theme: design tokens + modern skin over the legacy admin classes (main.css).
 * Loaded after main.css. One fixed light theme with a graphite accent.
 */

/* ========== Tokens ========== */

:root {
    --accent-base: #475569; /* graphite, approved as the only colour */

    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #eef0f4;
    --border: #e3e6ec;
    --border-strong: #cdd2db;
    --text: #1f2430;
    --text-muted: #5f6675;
    --text-subtle: #8f96a3;
    --row-alt: #fafbfc;
    --input-bg: #ffffff;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, .10);

    --accent: var(--accent-base);
    --accent-solid: var(--accent-base);
    --accent-hover: color-mix(in srgb, var(--accent-solid) 85%, black);
    --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
    --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);
    --on-accent: #ffffff;
    --link: #1d5fbf; /* blue, so links stand out from graphite text */
    --link-hover: #174b96;
    --topbar-bg: color-mix(in srgb, var(--accent-solid) 45%, #0d0b14);

    --success: #1f8a4c;
    --success-soft: #e7f6ed;
    --danger: #c62f2f;
    --danger-soft: #fdecec;
    --warning: #a46200;
    --warning-soft: #fff4dc;
    --info: #1f5f99;
    --info-soft: #e8f1fb;

    --radius: 10px;
    --radius-sm: 6px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    color-scheme: light;
}

/* ========== Base ========== */

/* "html body" outranks Bootstrap 3, which some pages (mailboxes) load after this file */
html body { font-family: var(--font); }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, ul.tabs li a, .leftNav ul li a, .ui-dialog .ui-dialog-title {
    font-family: var(--font);
    color: inherit;
}
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.01em; }
h5, h6 { font-weight: 600; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

hr { border: 0; border-top: 1px solid var(--border); }
.inactive { color: inherit; }
::selection { background: var(--accent-ring); }

/* ========== Layout ========== */

.wrapper {
    width: auto;
    max-width: 1520px;
    padding: 0 24px;
    box-sizing: border-box;
}

.content { width: calc(100% - 264px); }
.content .title { width: auto; }
.pagination, .breadCrumb { width: auto; }

/* Top bar */
#topNav { height: 48px; }
#topNav .fixed {
    background: var(--topbar-bg);
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 2px 8px rgba(0, 0, 0, .15);
    height: 48px;
}
#topNav .wrapper { display: flex; align-items: center; height: 48px; }
/* Brand logo in the top bar, white on the accent background */
#topNav .brand { display: flex; align-items: center; margin-right: auto; padding-left: 10px; } /* aligns with the left menu icons */
/* White SVG logo keeps the #A054A0 square; 26px tall = ~99px wide (styleguide minimum 96px) */
#topNav .brand img { display: block; height: 26px; width: auto; }
.welcome { display: flex; align-items: center; gap: 8px; float: none; padding-right: 12px; margin-right: 4px; border-right: 1px solid rgba(255, 255, 255, .2); }
.welcome img { margin: 0; border-radius: 50%; width: 26px; height: 26px; object-fit: cover; float: none; }
.welcome span { color: #fff; font-size: 13px; font-weight: 500; padding: 0; float: none; }
.userNav { float: none; font-size: 12px; }
.userNav ul { display: flex; margin: 0; }
.userNav ul li, .userNav ul li:first-child { border: 0; border-radius: var(--radius-sm); }
.userNav ul li:hover, .userNav .selected { background: rgba(255, 255, 255, .1); }
.userNav ul li a { color: rgba(255, 255, 255, .88); display: flex; align-items: center; }
.userNav ul li span.ico { display: inline-block; float: none; padding: 0; margin-left: 10px; opacity: .85; }
.ico {
    display: inline-block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    vertical-align: middle;
}
.ico-user { --icon: url(../icons/lucide/user.svg); }
.ico-shield { --icon: url(../icons/lucide/shield-check.svg); }
.ico-settings { --icon: url(../icons/lucide/settings.svg); }
.ico-logout { --icon: url(../icons/lucide/log-out.svg); }
.ico-home { --icon: url(../icons/lucide/house.svg); }
.ico-pencil { --icon: url(../icons/lucide/pencil.svg); }
.userNav ul li span { padding: 8px 12px 8px 8px; white-space: nowrap; }

/* Header with logo and quick links */
#header { height: auto; padding: 20px 24px 12px; display: flex; align-items: center; gap: 24px; }
#header .fix { display: none; }
.logo { margin: 0; float: none; flex-shrink: 0; }
.logo img { display: block; height: 30px; width: auto; }

/* Quick links start at the content column (sidebar 240px + 24px gap) */
.middleNav { float: none; margin: 0 0 0 264px; }
.middleNav ul { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.middleNav ul li { height: auto; min-width: 0; margin: 0; float: none; }
.middleNav ul li a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: none;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    transition: border-color .15s, color .15s, background-color .15s;
}
.middleNav ul li a:hover, .middleNav ul li a:active {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}
.middleNav ul li a span,
.middleNav ul li[class] a span {
    background: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

/* Monochrome icons tinted via mask (inherit currentColor) */
.middleNav ul li a span::before,
.leftNav > ul > li > a > span::before {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    opacity: .85;
}

.middleNav li.iMes { --icon: url(../icons/lucide/message-square.svg); }
.middleNav li.iStat { --icon: url(../icons/lucide/chart-line.svg); }
.middleNav li.iUser { --icon: url(../icons/lucide/users.svg); }
.middleNav li.iOrders { --icon: url(../icons/lucide/file-check.svg); }
.middleNav li.iFiles { --icon: url(../icons/lucide/files.svg); }
.middleNav li.iClipboard { --icon: url(../icons/lucide/clipboard-list.svg); }
.middleNav li.iStats { --icon: url(../icons/lucide/chart-column.svg); }
.middleNav li.iMap { --icon: url(../icons/lucide/map-pin.svg); }

/* Header dropdown */
.dropdown-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 4px;
    z-index: 1000;
    top: 100%;
    right: 0;
}
.dropdown-content button {
    background: transparent;
    color: var(--text);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    text-transform: none;
}
.dropdown-content button:hover { background: var(--accent-soft); color: var(--accent); }

/* Left navigation */
.leftNav { width: 240px; margin: 4px 24px 80px 0; }
.leftNav ul li a,
.leftNav ul li a:hover,
.leftNav ul li a.active {
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    margin-top: 2px;
    transition: background-color .12s, color .12s;
}
.leftNav ul li a:hover { background: var(--surface-3); color: var(--text); }
.leftNav ul li a.active { background: var(--accent-soft); color: var(--accent); }
.leftNav ul li a span,
.leftNav ul li[class] a span {
    background: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
}
.leftNav li.dash { --icon: url(../icons/lucide/layout-grid.svg); }
.leftNav li.graphs { --icon: url(../icons/lucide/chart-line.svg); }
.leftNav li.forms { --icon: url(../icons/lucide/pencil.svg); }
.leftNav li.gallery { --icon: url(../icons/lucide/briefcase.svg); }
.leftNav li.typo { --icon: url(../icons/lucide/pencil.svg); }
.leftNav li.tables { --icon: url(../icons/lucide/layout-grid.svg); }
.leftNav li.cal { --icon: url(../icons/lucide/calendar.svg); }
.leftNav li.errors { --icon: url(../icons/lucide/folder.svg); }
.leftNav li.files { --icon: url(../icons/lucide/files.svg); }
.leftNav li.login { --icon: url(../icons/lucide/user.svg); }
.leftNav li.pic { --icon: url(../icons/lucide/layout-grid.svg); }
.leftNav li.widgets { --icon: url(../icons/lucide/layout-grid.svg); }
.leftNav li.contacts { --icon: url(../icons/lucide/users.svg); }
.leftNav li.mail { --icon: url(../icons/lucide/mail.svg); }
.leftNav li.money { --icon: url(../icons/lucide/banknote.svg); }
/* Per-item icons (ni-<lucide name>) set in base.html; listed after the legacy fallbacks so they win */
.leftNav li.ni-house { --icon: url(../icons/lucide/house.svg); }
.leftNav li.ni-file-text { --icon: url(../icons/lucide/file-text.svg); }
.leftNav li.ni-circle-help { --icon: url(../icons/lucide/circle-help.svg); }
.leftNav li.ni-map-pin { --icon: url(../icons/lucide/map-pin.svg); }
.leftNav li.ni-briefcase { --icon: url(../icons/lucide/briefcase.svg); }
.leftNav li.ni-file-chart-column { --icon: url(../icons/lucide/file-chart-column.svg); }
.leftNav li.ni-chart-pie { --icon: url(../icons/lucide/chart-pie.svg); }
.leftNav li.ni-trending-up { --icon: url(../icons/lucide/trending-up.svg); }
.leftNav li.ni-tags { --icon: url(../icons/lucide/tags.svg); }
.leftNav li.ni-user-plus { --icon: url(../icons/lucide/user-plus.svg); }
.leftNav li.ni-globe { --icon: url(../icons/lucide/globe.svg); }
.leftNav li.ni-flame { --icon: url(../icons/lucide/flame.svg); }
.leftNav li.ni-list-plus { --icon: url(../icons/lucide/list-plus.svg); }
.leftNav li.ni-contact { --icon: url(../icons/lucide/contact.svg); }
.leftNav li.ni-calculator { --icon: url(../icons/lucide/calculator.svg); }
.leftNav li.ni-database { --icon: url(../icons/lucide/database.svg); }
.leftNav li.ni-users { --icon: url(../icons/lucide/users.svg); }
.leftNav li.ni-calendar { --icon: url(../icons/lucide/calendar.svg); }
.leftNav li.ni-message-square { --icon: url(../icons/lucide/message-square.svg); }
.leftNav li.ni-building-2 { --icon: url(../icons/lucide/building-2.svg); }
.leftNav li.ni-upload { --icon: url(../icons/lucide/upload.svg); }
.leftNav li.ni-ellipsis { --icon: url(../icons/lucide/ellipsis.svg); }
.leftNav li.ni-user-cog { --icon: url(../icons/lucide/user-cog.svg); }
.leftNav li.ni-phone-call { --icon: url(../icons/lucide/phone-call.svg); }
.leftNav li.ni-shield-check { --icon: url(../icons/lucide/shield-check.svg); }
.leftNav li.ni-scan-search { --icon: url(../icons/lucide/scan-search.svg); }
.leftNav li.ni-trash-2 { --icon: url(../icons/lucide/trash-2.svg); }
.leftNav li.ni-sliders-horizontal { --icon: url(../icons/lucide/sliders-horizontal.svg); }
.leftNav li.ni-chart-column { --icon: url(../icons/lucide/chart-column.svg); }
.leftNav li.ni-file-x { --icon: url(../icons/lucide/file-x.svg); }
.leftNav li.ni-mailbox { --icon: url(../icons/lucide/mailbox.svg); }

.leftNav ul.sub { margin: 2px 0 6px 18px; padding-left: 10px; border: 0; border-left: 1px solid var(--border); background: none; }
.leftNav ul.sub li { background: none; border: 0; }
/* :root prefix outranks the dark-mode inline-color override below */
:root .leftNav ul.sub li a,
:root .leftNav ul.sub li a[style] {
    color: var(--text-muted) !important;
    font-size: 13px;
    font-weight: 400;
    padding: 5px 10px;
    margin: 1px 0;
    background: none;
    border: 0;
}
:root .leftNav ul.sub li a:hover { background: var(--surface-3); color: var(--text) !important; }
:root .leftNav ul.sub li.this a, :root .leftNav ul.sub li a.active { color: var(--accent) !important; font-weight: 500; }
.leftNav .repeate_background_on_hover:hover, .leftNav .repeate_background_on_hover.active { background-repeat: no-repeat !important; }

/* Footer */
#footer { background: transparent; border-top: 1px solid var(--border); }
#footer span, #footer span a { color: var(--text-subtle); }

/* ========== Content blocks ========== */

.content .title {
    background: none;
    box-shadow: none;
    height: auto;
    min-height: 0;
    display: flow-root;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.content .title h5 { color: var(--text); font-size: 20px; font-weight: 650; padding: 4px 0; letter-spacing: -.01em; }

.widget, .table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    margin-top: 24px;
}
.head, .headTitle {
    /* contain the floated h5s so following blocks don't wrap beside them */
    display: flow-root;
    height: auto;
    min-height: 38px;
    background: var(--surface-2);
    border-top: 0;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.widget .head h5, .table h5, .acc .head h5 {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
}
/* Card titles rendered as a link (e.g. "Notatki") look like the other card titles */
.widget .head .userLink { color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 600; margin-left: 8px; padding-top: 0; }
.widget .head .userLink:hover { color: var(--text); text-decoration: none; }
.widget .head .userWidget { display: flex; align-items: center; padding: 9px 16px; }
.widget .head .userWidget form { margin: 0; }

/* Room for the Lucide icon drawn before card titles */
.widget .head h5[class], .table h5[class] { padding-left: 36px; }
/* Lucide icons for the legacy icon classes used in card headers */
:is(.head, .table) h5:is(.iList,.iUser,.iFrames,.iMoney,.iFolder,.iFiles,.iPencil,.iChart8,.iUpload,.iStats,.iPhone3,.iGraph,.iDayCalendar,.iArchive) { background-image: none; position: relative; }
:is(.head, .table) h5:is(.iList,.iUser,.iFrames,.iMoney,.iFolder,.iFiles,.iPencil,.iChart8,.iUpload,.iStats,.iPhone3,.iGraph,.iDayCalendar,.iArchive)::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background-color: var(--text-muted);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
h5.iList { --icon: url(../icons/lucide/list.svg); }
h5.iUser { --icon: url(../icons/lucide/user.svg); }
h5.iFrames { --icon: url(../icons/lucide/layout-grid.svg); }
h5.iMoney { --icon: url(../icons/lucide/banknote.svg); }
h5.iFolder { --icon: url(../icons/lucide/folder.svg); }
h5.iFiles { --icon: url(../icons/lucide/files.svg); }
h5.iPencil { --icon: url(../icons/lucide/pencil.svg); }
h5.iChart8 { --icon: url(../icons/lucide/chart-column.svg); }
h5.iUpload { --icon: url(../icons/lucide/upload.svg); }
h5.iStats { --icon: url(../icons/lucide/chart-column.svg); }
h5.iPhone3 { --icon: url(../icons/lucide/phone.svg); }
h5.iGraph { --icon: url(../icons/lucide/chart-line.svg); }
h5.iDayCalendar { --icon: url(../icons/lucide/calendar.svg); }
h5.iArchive { --icon: url(../icons/lucide/archive.svg); }
.widget .body { padding: 14px 16px; }
.widget .num a { border-radius: var(--radius-sm); }

blockquote { background: var(--surface-2); border-color: var(--border); border-left-color: var(--accent); width: auto; }
.img, .issueSummary img { border-color: var(--border); }

/* Tabs */
ul.tabs, .tabsRight ul.tabs { background: var(--surface-2); border-color: var(--border); }
ul.tabs li, .tabsRight ul.tabs li { background: none; font-size: 13.5px; font-weight: 500; }
ul.tabs li a { color: var(--text-muted); }
ul.tabs li a:hover { color: var(--text); }
html ul.tabs li.activeTab { background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
html ul.tabs li.activeTab a { color: var(--accent); }

/* Breadcrumb */
.breadCrumb { background: var(--surface); border-color: var(--border); border-radius: var(--radius-sm); }

/* FullCalendar: the title was absolutely placed at a fixed 600px and covered the "prev" button in the wider layout */
.fc-header-center { left: 0; right: 0; width: auto; pointer-events: none; }
.fc-header-center > * { pointer-events: auto; }

/* ========== Notifications ========== */

.nNote {
    border-radius: var(--radius-sm);
    background-color: var(--info-soft);
    border: 1px solid transparent;
    background-position: 16px center;
    display: flow-root;
}
.nNote { position: relative; background-image: none; }
.nNote::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    background-color: currentColor;
    -webkit-mask: var(--icon, url(../icons/lucide/info.svg)) center / contain no-repeat;
    mask: var(--icon, url(../icons/lucide/info.svg)) center / contain no-repeat;
}
.nWarning { --icon: url(../icons/lucide/triangle-alert.svg); }
.nSuccess { --icon: url(../icons/lucide/circle-check.svg); }
.nFailure { --icon: url(../icons/lucide/circle-x.svg); }
.nLightbulb { --icon: url(../icons/lucide/lightbulb.svg); }
.nMessages { --icon: url(../icons/lucide/mail.svg); }
.nNote p { color: inherit; font-size: 13px; padding: 12px 20px 12px 48px; }
.nWarning, .nLightbulb { background-color: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.nSuccess { background-color: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.nFailure { background-color: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.nInformation, .nMessages { background-color: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* ========== Tables ========== */

table.display, .tableStatic { color: var(--text); }
table.display thead th, table.display tfoot th, .tableStatic thead td, .tableStatic thead th {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    padding-top: 8px;
    padding-bottom: 8px;
}
table.display thead th div.DataTables_sort_wrapper { color: var(--text-muted); }
table.display tr, .tableStatic tbody tr { border-color: var(--border); }
table.display td, .tableStatic tbody td { border-color: var(--border); }
table.display tr.odd, table.display tr.odd.gradeA, table.display tr.odd.gradeU { background-color: var(--surface); }
table.display tr.even, table.display tr.even.gradeA, table.display tr.even.gradeU,
.tableStatic tbody tr:nth-child(even) { background-color: var(--row-alt); }
table.display tbody tr:hover, .tableStatic tbody tr:hover { background-color: var(--accent-soft); }
table.display tr.odd td.sorting_1, table.display tr.even td.sorting_1,
table.display tr.odd td.sorting_2, table.display tr.even td.sorting_2,
table.display tr.odd td.sorting_3, table.display tr.even td.sorting_3 { background-color: transparent; }
table.display tr.row_selected td { background-color: var(--accent-soft); }

.dataTables_wrapper, .dataTables_info, .dataTables_length, .dataTables_filter { color: var(--text-muted); }
.dataTables_wrapper .ui-toolbar, .dataTables_wrapper .fg-toolbar { background: var(--surface-2); border-color: var(--border); }

/* ========== Buttons ========== */

input[type=submit], input[type=reset], input[type=button], button, .button {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    line-height: 16px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
}

.basicBtn, .btn14, .btn55, .btnIconLeft {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    box-shadow: none;
}
.basicBtn:hover, .btn14:hover, .btn55:hover, .btnIconLeft:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btnIconLeft .icon { border-color: var(--border); }
.btn55 span { color: var(--text); }

/* Legacy "blue" and "greyish" buttons are both primary actions: one accent colour for all */
.blueBtn, .seaBtn, .greyishBtn {
    background: var(--accent-solid);
    border: 1px solid var(--accent-solid);
    color: var(--on-accent);
}
.blueBtn:hover, .seaBtn:hover, .greyishBtn:hover, .blueBtn:active, .seaBtn:active, .greyishBtn:active { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

.blackBtn {
    background: #3a4150;
    border: 1px solid #3a4150;
    color: #fff;
}
.blackBtn:hover, .blackBtn:active { background: #2b313d; border-color: #2b313d; }

.greenBtn { background: #1f8a4c; border: 1px solid #1f8a4c; color: #fff; }
.greenBtn:hover, .greenBtn:active { background: #18703d; border-color: #18703d; }
.redBtn { background: #c62f2f; border: 1px solid #c62f2f; color: #fff; }
.redBtn:hover, .redBtn:active { background: #a52424; border-color: #a52424; }

.basicBtn, .blueBtn, .seaBtn, .greyishBtn, .blackBtn, .greenBtn, .redBtn {
    background-image: none;
    transition: background-color .12s, border-color .12s, filter .08s, transform .08s;
}
/* Pressed feedback on click, darker than hover */
:is(.basicBtn, .blueBtn, .seaBtn, .greyishBtn, .blackBtn, .greenBtn, .redBtn):active:not(:disabled) {
    filter: brightness(.85);
    transform: translateY(1px);
}
:is(.basicBtn, .blueBtn, .seaBtn, .greyishBtn, .blackBtn, .greenBtn, .redBtn):focus-visible,
button:focus-visible, input[type=submit]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ========== Forms ========== */

input[type=text], input[type=email], input[type=number], input[type=password], input[type=search],
input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=time],
input:not([type]), select, textarea,
.mainForm input[type=text], .mainForm input[type=password], .mainForm textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    padding: 5px 8px;
    transition: border-color .12s, box-shadow .12s;
}
.mainForm input[type=text]:hover, .mainForm input[type=password]:hover, .mainForm textarea:hover {
    background-color: var(--input-bg);
    border-color: var(--border-strong);
}
/* Button-type inputs are excluded so they keep their own colour when clicked */
input:not([type=button], [type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=file]):focus,
select:focus, textarea:focus,
.mainForm input[type=text]:focus, .mainForm input[type=password]:focus, .mainForm textarea:focus {
    background-color: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    outline: 0;
}
/* Textareas grow only downwards and stay inside their container; line-numbered ones are sized by their plugin */
textarea:not(.linedtextarea textarea) { resize: vertical; max-width: 100%; box-sizing: border-box; }
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-solid); }

label { color: inherit; }
.rowElem, .rowElem2, .loginRow { border-color: var(--border); }
.itemDisabled { color: var(--text-subtle); }
.searchWidget input[type=text] { background: var(--input-bg); border-color: var(--border-strong); }

/* ========== Pagination ========== */

.pages li a {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
}
.pages li a:hover { border-color: var(--accent); color: var(--accent); }
.pages li a.active, .pages li.active a { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
/* Numbered pager: <div class="widget-pager"> with links, .widget-pager-current, .widget-pager-ellipsis, .widget-pager-info */
.widget-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.widget-pager a, .widget-pager .widget-pager-current {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); text-decoration: none; font-size: 12px;
}
.widget-pager a:hover { border-color: var(--accent); color: var(--accent); }
.widget-pager .widget-pager-current { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); font-weight: 600; }
.widget-pager .widget-pager-ellipsis { padding: 4px 4px; color: var(--text-subtle); }
.widget-pager .widget-pager-info { color: var(--text-muted); font-size: 12px; margin-left: 6px; }

/* ========== Dialogs / modals / widgets from plugins ========== */

.ui-widget-content { background: var(--surface); color: var(--text); border-color: var(--border); }
.ui-widget-header { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.ui-dialog { border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 0; }
.ui-dialog .ui-dialog-titlebar { border-radius: var(--radius) var(--radius) 0 0; }
.ui-widget-overlay { background: rgba(10, 12, 18, .5); opacity: 1; }
.ui-datepicker { box-shadow: var(--shadow-md); border-radius: var(--radius-sm); }

.modal {
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.jquery-modal.blocker { background-color: rgba(10, 12, 18, .55); }

.tipsy-inner { border-radius: var(--radius-sm); }

/* ========== Client view (crm/editt_client.html) ========== */

/* Two equal form columns, label and field on one line */
.client-view .cl, .client-view .cr { width: 50%; box-sizing: border-box; }
.client-view .rowElem,
.client-view .cr .rowElem {
    display: flex;
    align-items: center;
    gap: 16px;
    width: auto;
    padding: 9px 16px !important;
    border-top-color: var(--border);
    flex-wrap: wrap;
}
.client-view .rowElem > label {
    float: none;
    flex: none;
    width: 170px !important;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.35;
}
.client-view .rowElem > .formRight,
.client-view .rowElem > .formRight2 {
    float: none;
    flex: 1 1 160px;
    min-width: 0;
    margin: 0;
}
.client-view .rowElem > .fix { display: none; }
.client-view .rowElem > .formRight:empty { display: none; }
.client-view .rowElem .formRight :is(input[type=text], input[type=email], input[type=number], input:not([type]), select, textarea) {
    width: 100%;
    box-sizing: border-box;
}
/* Line-numbered textarea (lined plugin) in the form layout: numbers beside the text, full width */
.client-view .linedwrap { display: flex; width: auto !important; box-sizing: border-box; }
.client-view .linedwrap .lines { float: none; flex: none; }
.client-view .linedwrap .linedtextarea { flex: 1; min-width: 0; }
.client-view .linedwrap .linedtextarea textarea { width: 100% !important; box-sizing: border-box; }
.client-view .rowElem:has(.linedwrap) { align-items: flex-start; } /* label at the top of the tall field */
.client-view .rowElem.hide { display: none; }

/* Fields still missing data (template marks their labels orange) */
.client-view label[style*="color:orange"] { color: var(--warning) !important; font-weight: 600; }

/* Telecom-consent call to action */
.client-view .rodo_button button {
    background: var(--danger-soft) !important;
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent) !important;
    color: var(--danger) !important;
    font-size: 13px !important;
    padding: 10px 18px !important;
}
.client-view .rodo_button button:hover { background: color-mix(in srgb, var(--danger) 18%, transparent) !important; }

/* Primary save action */
.client-view #save_client {
    background: var(--accent-solid);
    border-color: var(--accent-solid);
    color: var(--on-accent);
    padding: 8px 20px;
    font-size: 13px;
}
.client-view #save_client:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Spacing between stacked cards */
.client-view .widget { margin-top: 20px !important; }
.client-view .widget .head h5 + h5 { color: var(--text-muted); font-weight: 500; }
/* Disabled until required fields are filled (handleShowSaveButton in the template) */
.client-view #save_client:disabled,
.client-view #save_client:disabled:hover {
    background: var(--surface-3);
    border-color: var(--border);
    color: var(--text-subtle);
    cursor: not-allowed;
}
/* Checkboxes: the template shifts them -10px; align with the other fields */
.client-view span.jqTransformCheckboxWrapper { margin-left: 0; }
/* Branża / Typ rows: inline padding-top pushed the value below its label */
.client-view .rowElem[style*="display:flex"] > div[style*="padding-top"] { padding-top: 0 !important; }

/* Client form: stacked sections, each a 6-column grid of label-above-field cells */
.client-view .client-section {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 0 16px 18px;
    border-top: 1px solid var(--border);
}
.client-view .client-section:first-child { border-top: 0; }
.client-view .client-section-title {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.client-view .client-section .rowElem {
    grid-column: span 6;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    border-top: 0;
    padding: 0 !important;
}
.client-view .client-section .cs-1 { grid-column: span 1; }
.client-view .client-section .cs-2 { grid-column: span 2; }
.client-view .client-section .cs-3 { grid-column: span 3; }
.client-view .client-section .rowElem > label { width: auto !important; font-size: 12px; }
.client-view .client-section .rowElem > :is(.formRight, div) { flex: none; max-width: none; padding-top: 0 !important; }
.client-view .client-section .rowElem > br { display: none; }

/* Checkbox cells: box then label, on one line */
.client-view .client-section .cs-check {
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    align-self: end;
    gap: 8px;
    min-height: 34px;
}
.client-view .client-section .cs-check > label { color: var(--text); font-size: 13px; }
.client-view .client-section .cs-check > .formRight { flex: none; }
.client-view .client-checks {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
}
.client-view .client-checks > .rowElem { grid-column: auto; }

@media (max-width: 900px) {
    .client-view .client-section { grid-template-columns: minmax(0, 1fr); }
    .client-view .client-section :is(.cs-1, .cs-2, .cs-3) { grid-column: 1 / -1; }
}
/* Note editor (TinyMCE) spans the card like the other fields */
.client-view .tox-tinymce { width: 100% !important; border-color: var(--border-strong); border-radius: var(--radius-sm); }

/* ========== Random job view (crm/random.html), reuses .client-view sections ========== */

/* Action bar: block link on the left, "Ważny klient" and save on the right */
.random-view .random-actions { display: flex; align-items: center; gap: 20px; padding: 14px 16px; border-top: 1px solid var(--border); }
.random-view .random-actions > .fix { display: none; }
.random-view .random-block { order: 0; margin: 0 auto 0 0; float: none; }
.random-view .random-important { order: 1; }
.random-view .random-actions #save_client { order: 2; margin: 0; }
.random-view .random-important .label-checkbox-group { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; }
.random-view .random-important .label-checkbox-group p { margin: 0; }
.random-view .random-block { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); padding: 7px 14px; border-radius: var(--radius-sm); line-height: 18px; }
.random-view .random-block:hover { color: var(--danger); background: var(--danger-soft); }
/* Submit inputs in the action bar (crm/check_leads.html); "Jest OK" stays first in the DOM as the Enter default */
.random-view .random-actions .submitForm { float: none; margin: 0 0 0 auto; order: 1; }
.random-view .random-actions .random-block { margin: 0 auto 0 0; order: 0; }

/* Profile form (cms/accounts/profile.html): single column, fields not stretched across the card */
.profile-view .rowElem > .formRight { max-width: 420px; }
.profile-view .formRight:has(> select + select) { display: flex; gap: 6px; }
.profile-view .rowElem[style*="display:block"] { display: flex !important; } /* inline display:block on the last rows */

/* Old jWysiwyg editor (client mail, newsletter): fill the card instead of the plugin's inline pixel width */
div.wysiwyg { width: auto !important; box-sizing: border-box; }
div.wysiwyg iframe { width: 100% !important; box-sizing: border-box; }

/* RODO consent script (#popup_rodo): centred dialog over a dimmed page instead of a box over the form */
.client-view #popup_rodo {
    position: fixed;
    top: 80px; /* below the 48px top bar */
    left: 50%;
    transform: translateX(-50%);
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 128px);
    box-sizing: border-box;
    min-height: 0;
    overflow-y: auto;
    margin: 0 !important;
    padding: 8px 32px 24px;
    z-index: 10050;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md), 0 0 0 100vmax rgba(15, 18, 25, .45);
    font-size: 14px;
}
.client-view #popup_rodo h3 {
    font-size: 13px !important;
    font-weight: 650;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 24px 0 8px !important;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.client-view #popup_rodo p { margin: 0 0 8px; line-height: 1.6; }
.client-view #popup_rodo > div[style*="font-size:15px"] { font-size: 14px !important; }
.client-view #popup_rodo .consent_table { width: 100% !important; margin: 16px 0 !important; }
.client-view #popup_rodo .consent_table td { padding: 8px 12px; vertical-align: middle; }
.client-view #popup_rodo .consent_required_field { background: var(--accent-soft); }
.client-view #popup_rodo #close_rodo {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text) !important;
    font-weight: 500;
}
.client-view #popup_rodo #close_rodo:hover { background: var(--surface-3); }

/* ========== Login / two-factor pages (two_factor/_base_focus.html) ========== */

.backTo { float: none; margin-right: auto; }
.backTo a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: rgba(255, 255, 255, .88); font-size: 12px; border: 0; }
.backTo a span { padding: 0; float: none; }
.backTo span.ico { margin: 0; }
.loginPanel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.loginPanel .head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.loginPanel .head h5 { font-size: 14px; font-weight: 600; }
.loginPanel :is(tr, td, th) { border-color: var(--border) !important; }
.loginPanel input:is([type=text], [type=password], [type=number], [type=tel]) {
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm);
    padding: 7px 10px !important;
    font: inherit !important;
}
.loginPanel input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.loginPanel .btn { border-radius: var(--radius-sm); font-weight: 500; }
.loginPanel .btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
.loginPanel .btn-primary:hover, .loginPanel .btn-primary:focus { background: var(--accent-hover); border-color: var(--accent-hover); }
/* The disabled "Back" on the first step is only noise */
.loginPanel .btn-disabled { display: none; }
/* 2FA wizard: "Porzuć" (pull-right link) kept off the card edge */
.loginPanel .pull-right.btn-link { margin-right: 16px; }

/* ========== RODO acceptance page (rodo/rodo.html) ========== */

.download-button button {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    padding: 8px 14px;
    margin: 16px 20px 0;
    cursor: pointer;
}
.download-button button:hover { background: var(--surface-3); }
.mainForm .loginRow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-color: var(--border); }
.mainForm .loginRow > .loginInput { width: auto !important; height: auto !important; float: none; }
.mainForm .loginRow > .fix { display: none; }
.mainForm .loginRow > .submitForm { margin-left: auto; }

/* Links styled as buttons get the same box as <button> */
a:is(.blueBtn, .seaBtn, .greyishBtn, .greenBtn, .redBtn) {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

/* Plain ".btn" buttons (audits pages) as neutral secondary buttons; coloured variants keep their own style */
:is(a, button, input).btn:not([class*="Btn"], .btn-crm, .btn-primary, .btn-danger) {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    padding: 6px 12px;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}
:is(a, button, input).btn:not([class*="Btn"], .btn-crm, .btn-primary, .btn-danger):hover { background: var(--surface-3); color: var(--text); }

/* RODO password change: fields fill the panel; logo already sits in the top bar */
.loginPanel { height: auto !important; }
.loginPanel .loginRow { padding-left: 14px; padding-right: 14px; }
.loginPanel .loginRow > .loginInput { flex: 1; min-width: 0; }
.loginPanel .loginRow .loginInput input { width: 100% !important; box-sizing: border-box; }
.wrapper > .content .loginLogo { display: none; }

/* ========== Collapsible card ========== */

/* <details class="widget widget-collapsible"> with <summary class="head">: the header toggles, chevron on the right */
.widget-collapsible > summary.head { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.widget-collapsible > summary.head::-webkit-details-marker { display: none; }
.widget-summary-note { margin-left: auto; margin-right: 14px; color: var(--text-muted); font-size: 12px; }
.widget-summary-note b { color: var(--text); }
.widget-collapsible > summary.head::after {
    content: ""; width: 7px; height: 7px; margin-right: 18px; transform: rotate(45deg);
    border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transition: transform .15s;
}
.widget-collapsible:not([open]) > summary.head { border-bottom-color: transparent; }
.widget-collapsible:not([open]) > summary.head::after { transform: rotate(-45deg); }

/* ========== Assistant groups (crm/industry_type_group_management.html) ========== */

.itg-wrap { padding: 16px; }
.itg-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.itg-field { display: flex; flex-direction: column; gap: 6px; }
.itg-field > label { font-weight: 600; font-size: 12px; color: var(--text-muted); }
.itg-field select[multiple] { min-width: 220px; height: 120px; padding: 4px; overflow: auto; }
.itg-field select:not([multiple]),
.itg-field input[type="number"] { min-width: 140px; height: 30px; padding: 2px 6px; }
.itg-field input[type="number"] { width: 90px; min-width: 90px; }
.itg-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.itg-actions a.basicBtn { display: inline-block; padding: 6px 14px; line-height: 16px; font-size: 12px; font-weight: 600; text-decoration: none; }
.itg-checkbox { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Bulk form: fields share one top line, the long hint wraps under its checkbox, button sits bottom-right */
#itg-bulk-form { align-items: flex-start; flex-wrap: nowrap; }
#itg-bulk-form .itg-field:has(.itg-checkbox) { flex: 1; max-width: 420px; }
#itg-bulk-form .itg-actions { align-self: flex-end; }
.itg-hint { margin: 0; color: var(--text-muted); font-size: 12px; }
.itg-hint strong { color: var(--text); }

.itg-table { width: 100%; border-collapse: collapse; }
.itg-table thead th {
    background: var(--surface-2); text-align: left; padding: 8px 12px;
    border-bottom: 1px solid var(--border); color: var(--text-muted);
    font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.itg-table thead th a { color: inherit; text-decoration: none; }
.itg-table thead th a:hover { color: var(--accent); }
.itg-table tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.itg-table tbody tr:last-child td { border-bottom: 0; }
.itg-table tbody tr:hover { background: var(--accent-soft); }
.itg-table select[multiple] { min-width: 160px; height: 78px; }
.itg-table select:not([multiple]) { height: 28px; }
.itg-free-count { text-align: right !important; font-variant-numeric: tabular-nums; }
td.itg-free-count { font-weight: 600; }
.itg-table tbody tr.itg-group-empty td { background: var(--danger-soft); }
.itg-empty-badge {
    margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    color: var(--danger); background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

/* Free records report: the include carries inline styles for the e-mail; restyle it on this page only */
.itg-report { padding: 0; }
.itg-report > p { color: var(--text-muted) !important; margin: 0 !important; padding: 12px 16px; }
.itg-report table { width: 100%; margin: 0 !important; }
.itg-report thead tr { background: var(--surface-2) !important; }
.itg-report th, .itg-report td { border: 0 !important; border-bottom: 1px solid var(--border) !important; padding: 8px 12px !important; }
.itg-report th:first-child, .itg-report td:first-child { padding-left: 16px !important; }
.itg-report th:last-child, .itg-report td:last-child { padding-right: 16px !important; }
.itg-report tr:last-child td { border-bottom: 0 !important; }
.itg-report th { color: var(--text-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.itg-report td { font-variant-numeric: tabular-nums; }
.itg-report tbody tr:hover { background: var(--accent-soft); }
