/* ============================================================================
   Тема личного кабинета корпоративного клиента.

   Весь внешний вид управляется через CSS-переменные в :root ниже.
   Чтобы изменить оформление (цвета/шрифты/отступы), НЕ правьте этот файл —
   переопределите нужные переменные в branding/custom.css (он подключается
   последним и перекрывает значения отсюда). Логотипы/слоган/ссылки — там же,
   в каталоге branding (см. branding/README.md).
   ============================================================================ */

:root {
    --font-family: Arial, Helvetica, sans-serif;
    --font-size-base: 14px;

    --color-bg: #19181a;
    --color-text: #231f20;
    --color-muted: #898989;
    --color-accent: #fdcb00;
    --color-link: #6b4e24;
    --color-error: #c0392b;
    --color-success: #2e7d32;

    --header-text: #e1e1e1;
    --content-bg: #f9f9f9;
    --content-text: #231f20;

    --table-border: #c7c8ca;
    --table-header-bg: #ededed;
    --table-stripe-bg: #f0f0f0;

    --button-bg: var(--color-accent);
    --button-text: #231f20;
    --button-radius: 3px;

    --balance-bg: #f9f9f9;
    --balance-text: #282828;

    --content-max-width: 1100px;
    --content-padding: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--color-bg);
    color: var(--content-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.4;
    /* Sticky footer: на коротких страницах подвал у нижнего края окна,
       на длинных — сразу за содержимым. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

#all {
    flex: 1 0 auto; /* растягивается, прижимая подвал вниз */
}

.wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 10px;
}

/* ---- Шапка ---------------------------------------------------------------- */

#header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    color: var(--header-text);
}

#logo {
    display: inline-block;
    font-size: 1.6em;
    font-weight: bold;
    color: var(--color-accent);
    text-decoration: none;
    padding: 8px 0;
}

#logo img {
    display: block;
}

#footer-logo img {
    display: block;
}

#footer-text {
    padding-left: 20px;
}

#header-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    color: var(--header-text);
}

#header-info h3 {
    color: var(--header-text);
    font-size: 1.05em;
    font-weight: normal;
}

#header-info .legend {
    color: var(--color-accent);
    margin-top: 6px;
}

#balance {
    width: 130px;
    background: var(--balance-bg);
    color: var(--balance-text);
    border-radius: var(--button-radius);
    overflow: hidden;
}

#balance h2 {
    background: var(--color-accent);
    color: #231f20;
    text-align: center;
    padding: 5px;
    font-size: 1em;
}

#balance div {
    padding: 8px;
}

#balance strong {
    display: block;
    font-size: 1.4em;
    text-align: center;
    border-bottom: 1px solid #bababa;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

#balance #balance-limit {
    text-align: center;
}

#cart,
#client {
    max-width: 260px;
}

#blockcapt {
    color: var(--color-error);
}

/* ---- Меню ----------------------------------------------------------------- */

#clients-menu {
    margin-top: 8px;
}

#clients-menu ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    background: var(--content-bg);
    border-radius: var(--button-radius) var(--button-radius) 0 0;
}

#clients-menu li a {
    display: block;
    padding: 10px 14px;
    color: var(--color-text);
    text-decoration: underline;
}

#clients-menu li.selected a {
    background: var(--color-accent);
    text-decoration: none;
}

#clients-menu li a:hover {
    text-decoration: none;
    background: rgba(0, 0, 0, 0.05);
}

/* ---- Контент -------------------------------------------------------------- */

.content {
    background: var(--content-bg);
    color: var(--content-text);
    padding: var(--content-padding);
    border-radius: 0 0 var(--button-radius) var(--button-radius);
    /* Широкие таблицы прокручиваются внутри светлой панели, а не вылезают
       на тёмный фон страницы при сужении экрана. */
    overflow-x: auto;
}

.content h2,
.content h3 {
    color: var(--color-muted);
    margin-bottom: 14px;
}

.content p {
    padding-bottom: 10px;
}

.clear-block {
    clear: both;
}

.clear-block-left {
    clear: both;
    float: left;
}

/* ---- Таблицы -------------------------------------------------------------- */

table.main-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95em;
}

table.main-table th,
table.main-table td {
    padding: 6px 10px;
    border: 1px solid var(--table-border);
    text-align: left;
    vertical-align: top;
}

table.main-table thead th {
    background: var(--table-header-bg);
}

table.main-table tbody tr:nth-child(even) td {
    background: var(--table-stripe-bg);
}

table.sortable thead th {
    cursor: pointer;
}

table.sortable thead th.sort-asc::after {
    content: " \25B2";
}

table.sortable thead th.sort-desc::after {
    content: " \25BC";
}

.itogo1,
.itogo2 {
    text-align: right;
    font-weight: bold;
    color: #888;
}

.itogo1 strong,
.itogo2 strong {
    color: #000;
    margin-left: 20px;
}

.itogo2 {
    font-size: 1.1em;
    margin-top: 12px;
}

/* ---- Формы ---------------------------------------------------------------- */

#list-by-day {
    margin-bottom: 12px;
    font-size: 0.95em;
}

.report-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cabinet-form .form-row {
    margin-bottom: 12px;
}

.cabinet-form label {
    display: block;
    margin-bottom: 4px;
}

.cabinet-form small {
    color: var(--color-muted);
}

.input-field {
    padding: 5px 8px;
    border: 1px solid var(--table-border);
    border-radius: var(--button-radius);
}

input[type="submit"],
.button {
    display: inline-block;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: var(--button-radius);
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
}

input[type="submit"]:disabled {
    opacity: 0.5;
    cursor: default;
}

.required-note {
    color: var(--color-error);
}

/* ---- Сообщения ------------------------------------------------------------ */

.messages {
    margin-bottom: 16px;
}

.message {
    padding: 10px 14px;
    border-radius: var(--button-radius);
    margin-bottom: 8px;
}

.message-status {
    background: #e6f4ea;
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.message-error {
    background: #fde8e6;
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* ---- Подвал --------------------------------------------------------------- */

#footer {
    flex-shrink: 0;
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 20px 10px;
    color: #888;
}

#footer a {
    color: #888;
}

.error-stack {
    background: #fff;
    border: 1px solid var(--table-border);
    padding: 10px;
    overflow: auto;
    font-size: 0.85em;
}
