/* Dark Theme CSS for Laravel API - Based on Laravel React Design */

@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@400;500;600&family=Jura:wght@400;500;600;700&display=swap');

:root {
    /* Core colors - matching React dark theme */
    --background: oklch(0.145 0 0);
    --foreground: #ffffff;
    --card: oklch(0.18 0 0);
    --card-foreground: #ffffff;
    --primary: oklch(0.985 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: #ffffff;
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.82 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: oklch(0.269 0 0);
    --ring: oklch(0.439 0 0);
    
    /* Brand accent - amber/yellow like React app */
    --accent-amber: #fbbf24;
    --accent-amber-dark: #f59e0b;
    --accent-amber-light: rgba(251, 191, 36, 0.1);
    --accent-amber-border: rgba(251, 191, 36, 0.5);
    
    /* Typography */
    --font-size: 15px;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.8125rem;
    --input-data: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header: 'Jura', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-docs: 'Jura', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Layout */
    --width: 1200px;
    --radius: 0.55rem;
    --radius-lg: 0.9rem;
    --radius-xl: 1.2rem;
    
    /* Glass morphism effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-backdrop-blur: 20px;
}

/* Base styles */
html {
    font-size: var(--font-size);
    scroll-behavior: smooth;
}

body {
    font-family: var(--input-data);
    background: linear-gradient(to bottom, #000000, #0a0a0a);
    color: var(--foreground);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Wrapper and layout */
.align_center {
    width: 100%;
    min-height: 100vh;
}

.wrapper {
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 1rem;
}

.main {
    width: 100%;
    padding: 1.25rem 0;
    text-align: left;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--header);
    font-weight: 500;
    line-height: 1.5;
    color: var(--foreground);
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.65rem;
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.12rem;
}

p {
    margin-bottom: 1rem;
    color: var(--muted-foreground);
}

a {
    color: var(--accent-amber);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-amber-dark);
}

/* Glass morphism card effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.35rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--accent-amber-border);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.1);
}

/* Header styles */
header {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    padding: 0.75rem 0;
    margin-bottom: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.75rem;
    position: relative;
}

header a:not(.header-nav-menu__link):not(.header-bar__logo) {
    color: var(--foreground);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

header a:not(.header-nav-menu__link):hover {
    background: var(--glass-bg);
    color: var(--accent-amber);
}

header .fs-4,
.header-bar__title {
    font-family: var(--header);
    font-weight: 600;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation links in header */
.header-nav-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    min-width: 260px;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.header-nav-menu.is-open {
    display: flex;
}

.header-nav-menu__link {
    display: block;
    text-align: center;
    padding: 0.6rem 0.85rem;
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.header-nav-menu__link:hover {
    background: var(--glass-bg);
}

.header-nav-menu form {
    margin: 0;
}

/* Header project switch */
.header-project-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin-left: auto;
}

.header-project-switch__label {
    color: var(--muted-foreground);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.header-project-switch__select {
    min-width: 140px;
    max-width: 200px;
    height: 40px;
    padding: 0 2.25rem 0 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--foreground);
    font: inherit;
    font-size: 0.85rem;
    outline: none;
}

.header-project-switch__select:focus {
    border-color: var(--accent-amber-border);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.header-project-switch__select option {
    color: #111827;
}

/* Header language switch */
.header-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.header-lang-switch__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 34px;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.04);
}

.header-lang-switch__link.is-active {
    border-color: rgba(251, 191, 36, 0.45);
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

/* Burger button */
.header-burger {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.header-burger span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-amber);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.header-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Button styles - matching React design */
button,
.btn {
    font-family: var(--input-data);
    font-size: calc(var(--font-size) + 1px);
    font-weight: 600;
    line-height: 1.5;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    color: #ffffff;
}

/* Primary button - amber gradient */
.btn-primary,
button[type="submit"]:not(.btn-outline-secondary):not(.btn-outline-danger) {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-dark));
    color: #000000;
    border: none;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-primary:hover,
button[type="submit"]:not(.btn-outline-secondary):not(.btn-outline-danger):hover {
    background: linear-gradient(135deg, var(--accent-amber-dark), #d97706);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
    transform: translateY(-2px);
}

/* Secondary/outline button */
.btn-outline-secondary,
.btn-outline-danger {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--foreground);
    backdrop-filter: blur(10px);
}

a.btn,
.money-show-page a.btn,
.deposit-show-page a.btn,
.doc-page a.btn {
    color: var(--foreground);
}

.money-show-page a.btn-outline-secondary,
.deposit-show-page a.btn-outline-secondary,
.doc-page a.btn-outline-secondary {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.24);
}

.money-show-page a.btn-outline-secondary:hover,
.deposit-show-page a.btn-outline-secondary:hover,
.doc-page a.btn-outline-secondary:hover {
    color: var(--accent-amber);
    border-color: var(--accent-amber-border);
    background: rgba(251, 191, 36, 0.12);
}

.btn-success {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.24);
    border-color: rgba(34, 197, 94, 0.65);
    color: #bbf7d0;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.45);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.24);
    border-color: rgba(220, 38, 38, 0.65);
    color: #fecaca;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-amber-border);
    color: var(--accent-amber);
}

.btn-outline-danger:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.5);
    color: #f87171;
}

/* Form controls */
input,
select,
textarea,
.form-control,
.form-select {
    font-family: var(--input-data);
    font-size: var(--font-size);
    font-weight: 600;
    line-height: 1.5;
    padding: 0.75rem 0.85rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

/* Select elements in filter modal */
select {
    width: 100%;
    padding: 7px 12px;
    font-size: var(--font-size-sm);
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fbbf24' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

input::placeholder,
.form-control::placeholder {
    color: var(--muted-foreground);
}

label {
    font-family: var(--input-data);
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.35rem;
    display: block;
}

/* Tables - dark theme */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--foreground);
    border-collapse: collapse;
}

.table thead {
    background: var(--glass-bg);
    border-bottom: 2px solid var(--border);
}

.table thead th {
    padding: 0.6rem 0.7rem;
    font-weight: 600;
    text-align: left;
    color: var(--accent-amber);
    border-bottom: 2px solid var(--border);
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: var(--glass-bg);
}

.table tbody td {
    padding: 0.6rem 0.7rem;
    vertical-align: middle;
    color: #ffffff;
}

.table-bordered {
    border: 1px solid var(--border);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background: var(--glass-bg);
    border-color: var(--accent-amber-border);
}

/* Document cards - glass morphism */
.txtbox-price-docs {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 6% 10% 22% 14% 10% 33% 5%;
    gap: 0.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.txtbox-price-docs:hover {
    border-color: var(--accent-amber-border);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.1);
    transform: translateY(-2px);
}

/* On desktop, the header wrapper should be invisible to grid layout */
.order-card__header {
    display: contents;
}

.numdoc-docs a {
    font-family: var(--header);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-amber);
    text-decoration: none;
}

.numdoc-docs a:hover {
    text-decoration: underline;
}

/* Column: date/time */
.status-docs4.compact-date {
    font-size: var(--font-size-xs);
    color: #c8d0da;
}

/* Column: status */
.status-docs3 {
    font-size: var(--font-size-xs);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column: price/sum */
.pricebox-docs1 {
    text-align: right;
    font-family: var(--header);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.pricebox-docs1 .money {
    color: var(--foreground);
}

/* Column: note/content */
.captionbox-docs2 {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

/* Column: status icons */
.status-docs-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.status-docs-icons img.status-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.status-docs-icons .alink3 {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Mobile-only icons inside header — hidden on desktop */
.status-docs-icons--mobile {
    display: none;
}

.status-docs4,
.status-docs3,
.status-docs2 {
    font-size: var(--font-size-xs);
    color: #d1d5db;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    background: var(--glass-bg);
}

.captionbox-docs {
    flex: 1;
}

.captionbox-docs a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
}

.captionbox-docs a:hover {
    color: var(--accent-amber);
}

.captionbox-docs .city,
.captionbox-docs .phone {
    color: #b0b8c4;
    font-size: var(--font-size-xs);
}

.pricebox-docs1 {
    font-family: var(--header);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-amber);
    white-space: nowrap;
}

.pricebox-docs1 .money {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Alerts */
.alert {
    padding: 0.8rem 0.95rem;
    border-radius: var(--radius);
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.5);
    color: #f87171;
}

/* Login form */
.menu_content_login {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.4rem;
    max-width: 400px;
    margin: 2rem auto;
}

.menu_content_login input {
    width: 100%;
    margin-bottom: 0.75rem;
}

.menu_content_login button {
    width: 100%;
    padding: 0.6rem;
}

.menu_content_login a {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--accent-amber);
}

/* Filter panel */
.filter_box_center {
    background: var(--card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Pagination */
.navigator {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
}

.navigator button,
.navigator a {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.navigator button:hover,
.navigator a:hover {
    background: var(--accent-amber-light);
    border-color: var(--accent-amber-border);
    color: var(--accent-amber);
}

.navigator .active {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-dark));
    border-color: var(--accent-amber);
    color: #000000;
    font-weight: 600;
}

/* Badge/Status indicators */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-amber);
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.5);
}

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    padding: 1.4rem 0;
    margin-top: 2.5rem;
    color: var(--muted-foreground);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.5);
}

/* Container utilities */
.container {
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 1rem;
}

.container.mt-4 {
    margin-top: 1.25rem;
}

/* Grid system compatibility */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col-3,
.col-9,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-6 {
    padding: 0.5rem;
}

.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }

/* Flex utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.p-3 {
    padding: 0.85rem;
}

.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--glass-bg);
}

.card,
.modal-content,
.ttable {
    border-radius: var(--radius-lg);
}

.card-body,
.modal-body,
.modal-header,
.modal-footer {
    padding: 0.9rem 1rem;
}

.form-label,
.form-text,
small,
.small {
    font-size: var(--font-size-xs);
}

.fs-1,
.fs-2,
.fs-3,
.fs-4,
.fs-5 {
    line-height: 1.2;
}

.fs-3 {
    font-size: 1.6rem !important;
}

.fs-4 {
    font-size: 1.3rem !important;
}

.fs-5 {
    font-size: 1.1rem !important;
}

/* Animations */
@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Document section */
.document {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.document section {
    flex: 1;
}

/* Pricing header (welcome page) */
.pricing-header {
    max-width: 700px;
    margin: 0 auto;
}

.pricing-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-header p {
    font-size: 1.125rem;
    color: var(--muted-foreground);
}

.text-body-secondary {
    color: var(--muted-foreground);
}

/* Border utilities */
.border-bottom {
    border-bottom: 1px solid var(--border) !important;
}

/* Link utilities */
.link-body-emphasis {
    color: var(--foreground);
}

.link-body-emphasis:hover {
    color: var(--accent-amber);
}

.text-decoration-none {
    text-decoration: none;
}

/* Rounded corners */
.rounded {
    border-radius: var(--radius);
}

.rounded-w {
    border-radius: var(--radius-lg);
}

/* Responsive design */
@media (max-width: 768px) {
    .wrapper {
        padding: 0;
    }

    .main {
        width: 100%;
        padding: 1rem 0;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .txtbox-price-docs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .document {
        flex-direction: column;
    }
    
    .header-bar {
        padding: 0 0.5rem;
    }

    .header-nav-menu {
        right: 0.5rem;
        left: 0.5rem;
        min-width: 0;
    }
    
    .col-3,
    .col-9,
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row {
        flex-direction: column;
    }

    .doc-form-row-three-cols {
        flex-wrap: wrap;
        gap: 4px;
    }

    .doc-form-row-three-cols .col-f:nth-child(1) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .doc-form-row-three-cols .col-f:nth-child(2),
    .doc-form-row-three-cols .col-f:nth-child(3) {
        flex: 0 0 auto;
    }

    .doc-form-row-three-cols .col-f:nth-child(2) {
        max-width: 60%;
    }

    .doc-form-row-three-cols .col-f:nth-child(3) {
        max-width: 35%;
    }
}

@media (max-width: 576px) {
    .wrapper {
        padding: 0 0.75rem;
    }

    h1 { font-size: 1.25rem; }

    .glass-card {
        padding: 1rem;
    }
}

/* Document compact layout - top action bar */
.top-action-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.top-action-filter {
    flex: 0 0 auto;
}

.top-action-create {
    flex: 0 0 auto;
    margin: 0;
}

.top-action-create-btn {
    width: auto !important;
    min-width: 100px;
    padding: 0.4rem 0.8rem !important;
    margin: 0 !important;
    white-space: nowrap;
    font-size: 0.85rem !important;
}

.money-top-action-create {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.money-top-action-form {
    margin: 0;
}

.top-action-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.top-action-panel .tstr0 {
    margin-bottom: 0;
}

.top-action-panel .doc-tabs-wrap {
    margin: 0;
}

.top-action-panel .doc-tabs {
    gap: 4px;
    border-bottom: none;
}

.top-action-panel .doc-tab {
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
}

.top-action-panel .doc-tab__label {
    white-space: nowrap;
}

/* Document compact list */
.document-compact-wrap {
    overflow: hidden;
}

.document-compact-list {
    display: grid;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.document-compact-wrap .txtbox-price-docs {
    min-width: 1020px;
    grid-template-columns: 6% 10% 22% 14% 10% 33% 5%;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0;
}

.document-compact-wrap .numdoc-docs,
.document-compact-wrap .status-docs4,
.document-compact-wrap .captionbox-docs,
.document-compact-wrap .status-docs3,
.document-compact-wrap .pricebox-docs1,
.document-compact-wrap .captionbox-docs2,
.document-compact-wrap .status-docs-icons {
    min-width: 0;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-compact-wrap .captionbox-docs a,
.document-compact-wrap .captionbox-docs2,
.document-compact-wrap .compact-date {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-compact-wrap .compact-date {
    white-space: normal;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.document-compact-wrap .compact-date-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-compact-wrap .captionbox-docs a br,
.document-compact-wrap .captionbox-docs2 br,
.document-compact-wrap .status-docs4 br {
    display: none;
}

.document-compact-wrap .status-docs3 {
    padding: 0.3rem 0.5rem;
    height: auto;
    margin-top: 0;
    font-size: 0.78rem;
}

.document-compact-wrap .pricebox-docs1 {
    font-size: 0.88rem;
}

.document-compact-wrap .pricebox-docs1 .money {
    font-size: 0.88rem;
}

.document-compact-wrap .captionbox-docs2 {
    font-size: 0.78rem;
    line-height: 1.2;
}

.document-compact-wrap .status-docs-icons img.status-icon {
    width: 20px;
    height: 20px;
}

.document-compact-wrap .pricebox-docs1 {
    text-align: right;
}

.document-compact-wrap .captionbox-docs2 {
    font-size: 0.78rem;
    color: #d1d5db;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    word-break: break-word;
}

.document-compact-wrap .compact-sep {
    color: rgba(255, 255, 255, 0.52);
    margin: 0 0.35rem;
}

.document-compact-wrap .compact-main {
    font-weight: 600;
}

.document-compact-wrap .captionbox-docs a {
    white-space: normal;
    line-height: 1.15;
}

.document-compact-wrap .compact-client-line,
.document-compact-wrap .phone {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-compact-wrap .compact-client-line + .compact-client-line,
.document-compact-wrap .compact-client-line + .phone {
    margin-top: 0.12rem;
}

/* Zakaz variant with extra client info column */
.document-compact-wrap.zakaz .txtbox-price-docs,
.txtbox-price-docs.zakaz {
    min-width: 1120px;
    grid-template-columns: 42px 104px minmax(220px, 1fr) 150px minmax(130px, 0.72fr) 104px minmax(320px, 1.55fr);
}

/* Money index - summary cards */
.money-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.money-summary__card {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.money-summary__icon {
    font-size: 2rem;
}

.money-summary__label {
    font-weight: bold;
    font-size: 1.1em;
}

.money-summary__value {
    font-size: 1.25rem;
    font-weight: 700;
}

.money-summary__value--income {
    color: var(--accent-amber);
}

.money-summary__value--expense {
    color: #f87171;
}

/* Money index - document type badges */
.money-doc-type--po {
    color: green;
    font-weight: bold;
}

.money-doc-type--ro {
    color: red;
    font-weight: bold;
}

.money-doc-sum--po {
    font-weight: bold;
    color: green;
}

.money-doc-sum--ro {
    font-weight: bold;
    color: red;
}

/* Money index - filter modal */
.money-filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.money-filter-modal.is-open {
    display: flex;
}

.money-filter-modal__content {
    width: 720px;
    max-width: 92vw;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    margin: 0 auto;
    padding: 24px;
}

.money-filter-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    z-index: 10;
}

.money-filter-modal__title {
    margin: 0 0 16px 0;
}

.money-filter-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.money-filter-modal__field {
    display: block;
}

.money-filter-modal__field label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.money-filter-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.money-filter-modal__actions .btn {
    flex: 1;
}

/* Money index - table header */
.money-table thead {
    background: #efefef;
}

.money-table__client {
    font-size: 0.9em;
}

.money-table__comment {
    font-size: 0.9em;
}

/* Money index - pagination */
.money-pagination {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.money-pagination__meta {
    color: #9ca3af;
    font-size: 0.92rem;
}

.money-pagination__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.money-pagination__pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.money-pagination__page,
.money-pagination__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    text-decoration: none;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.18s ease;
}

.money-pagination__page:hover,
.money-pagination__nav:hover {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fff;
}

.money-pagination__page.is-active {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #111827;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.25);
}

/* Money index - action bar */
.money-action-bar {
    padding: 12px 16px;
    margin-bottom: 16px;
}

.money-action-bar__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.money-action-bar__filter-btn {
    /* inherits .btn styles */
    padding: 12px 16px;
}

.money-action-bar__filter-btn--active {
    /* inherits .btn-warning styles */
    padding: 12px 16px;
}

.money-empty {
    text-align: center;
    padding: 20px;
    color: #CC0000;
}

.money-filter-active-notice {
    margin-bottom: 16px;
}

/* Document show page */
.doc-page {
    padding: 12px 20px;
}

.doc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.doc-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.related-icons-bar {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.doc-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.doc-form-col {
    flex: 1;
    min-width: 0;
}

.doc-related-col {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 10px;
}

.compact-form .row {
    margin: 0;
}

.compact-form .col-f {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
}

.compact-form label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #fbbf24;
}

.compact-form .form-control,
.compact-form .form-select,
.compact-form .input-group {
    font-size: 0.85rem;
    padding: 4px 8px;
    height: auto;
}

.compact-form .input-group .form-control {
    padding: 4px 8px;
}

.compact-form .input-group .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.compact-form .client-search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: stretch;
}

.compact-form .client-search-row input {
    flex: 0 0 80%;
    max-width: 80%;
}

.compact-form .client-search-row button {
    white-space: nowrap;
    flex: 0 0 10%;
    min-width: 0;
    padding: 4px 8px;
    font-size: 0.78rem;
}

/* Number fields - shorter width */
.doc-form-row-numbers {
    max-width: 400px;
}

.col-f-number {
    max-width: 140px;
}

.form-control-number {
    max-width: 120px;
    text-align: right;
}

/* Goods table compact */
#goodsTable th,
#goodsTable td {
    padding: 4px 6px !important;
    font-size: 0.85rem;
}

/* Goods name input - full width */
#goodsTable td:nth-child(2) input[readonly] {
    width: 100%;
}

#goodsTable .form-control-sm {
    font-size: 0.82rem;
    padding: 2px 5px;
}

/* Related docs panel */
.related-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--foreground);
}

.related-panel h5 {
    font-size: 0.95rem;
    margin: 0 0 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.related-panel .tstr {
    padding: 3px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
}

.related-panel .ttable {
    margin: 6px 0;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    border: 1px solid var(--glass-border);
}

.related-panel .button {
    font-size: 0.8rem;
    padding: 3px 10px;
}

/* ── Related documents: links with doc-type icons ── */
.rel-doc-link {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    line-height: 1.5;
}

.rel-doc-link:hover {
    background: rgba(167, 139, 250, 0.2);
    color: #ddd6fe;
    border-color: rgba(167, 139, 250, 0.5);
    text-decoration: none;
}

/* Current doc — not a link, just a highlight */
.rel-doc-link--current {
    color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    cursor: default;
}

/* Проведено state */
.rel-doc-link--posted {
    color: #86efac;
    background: rgba(134, 239, 172, 0.08);
    border-color: rgba(134, 239, 172, 0.25);
}

.rel-doc-link--posted:hover {
    background: rgba(134, 239, 172, 0.15);
    border-color: rgba(134, 239, 172, 0.4);
}

/* Per-type accent colours */
.rel-doc-link--RN  { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.25); background: rgba(125, 211, 252, 0.07); }
.rel-doc-link--RN:hover  { background: rgba(125, 211, 252, 0.15); border-color: rgba(125, 211, 252, 0.45); }

.rel-doc-link--PN  { color: #93c5fd; border-color: rgba(147, 197, 253, 0.25); background: rgba(147, 197, 253, 0.07); }
.rel-doc-link--PN:hover  { background: rgba(147, 197, 253, 0.15); border-color: rgba(147, 197, 253, 0.45); }

.rel-doc-link--PO  { color: #fcd34d; border-color: rgba(252, 211, 77, 0.25);  background: rgba(252, 211, 77, 0.07); }
.rel-doc-link--PO:hover  { background: rgba(252, 211, 77, 0.15);  border-color: rgba(252, 211, 77, 0.45); }

.rel-doc-link--RO  { color: #f87171; border-color: rgba(248, 113, 113, 0.25); background: rgba(248, 113, 113, 0.07); }
.rel-doc-link--RO:hover  { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.45); }

.rel-doc-link--CH  { color: #a5b4fc; border-color: rgba(165, 180, 252, 0.25); background: rgba(165, 180, 252, 0.07); }
.rel-doc-link--CH:hover  { background: rgba(165, 180, 252, 0.15); border-color: rgba(165, 180, 252, 0.45); }

.rel-doc-link--WO1 { color: #fb923c; border-color: rgba(251, 146, 60, 0.25);  background: rgba(251, 146, 60, 0.07); }
.rel-doc-link--WO1:hover { background: rgba(251, 146, 60, 0.15);  border-color: rgba(251, 146, 60, 0.45); }

.rel-doc-link--RA  { color: #6ee7b7; border-color: rgba(110, 231, 183, 0.25); background: rgba(110, 231, 183, 0.07); }
.rel-doc-link--RA:hover  { background: rgba(110, 231, 183, 0.15); border-color: rgba(110, 231, 183, 0.45); }

/* Section headers inside related-panel */
.rel-doc-section {
    margin-top: 6px;
}

.rel-doc-section__title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
    padding: 4px 0 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 4px;
}

/* Action / create buttons */
.rel-doc-action-btn {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    line-height: 1.6;
}

.rel-doc-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
}

.rel-doc-action-btn--create {
    color: #86efac;
    background: rgba(134, 239, 172, 0.07);
    border-color: rgba(134, 239, 172, 0.22);
}

.rel-doc-action-btn--create:hover {
    background: rgba(134, 239, 172, 0.16);
    border-color: rgba(134, 239, 172, 0.45);
    color: #bbf7d0;
}

/* Balance pill */
.rel-doc-balance {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-amber);
    padding: 4px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}

/* Action buttons row */
.doc-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.doc-actions .btn {
    font-size: 0.85rem;
    padding: 5px 14px;
}

#newClientModal .form-label {
    color: var(--accent-amber);
    font-weight: 600;
}

#newClientModal .is-invalid {
    border-color: #dc3545;
}

/* Dark show pages */
.doc-page,
.money-show-page,
.deposit-show-page {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border);
    color: var(--foreground);
    backdrop-filter: blur(var(--glass-backdrop-blur));
}

.doc-page h2,
.money-show-page h3,
.deposit-show-page h3 {
    color: var(--accent-amber) !important;
    font-family: var(--header);
}

.doc-page label,
.money-show-page label,
.deposit-show-page label {
    color: var(--accent-amber);
    font-weight: 600;
}

.money-show-page .alert-secondary,
.money-show-page #selectedClientDetails,
.deposit-show-page .alert-secondary,
.doc-page .alert-secondary,
.doc-page .selected-client-details {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--border) !important;
    color: var(--foreground) !important;
}

.money-show-page .alert-warning,
.deposit-show-page .alert-warning,
.doc-page .alert-warning,
.doc-page .selected-client-details--empty {
    background: rgba(251, 191, 36, 0.12) !important;
    border-color: var(--accent-amber-border) !important;
    color: var(--foreground) !important;
}

.money-show-page .list-group-item,
.doc-page .list-group-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border);
    color: var(--foreground);
}

.money-show-page .list-group-item:hover,
.doc-page .list-group-item:hover {
    background: rgba(251, 191, 36, 0.12);
    color: var(--accent-amber);
}

.deposit-show-page .glass-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border) !important;
}

.deposit-show-page .glass-card div[style*="color:#92400e"],
.deposit-show-page .glass-card div[style*="color: #92400e"] {
    color: var(--accent-amber) !important;
}

.deposit-show-page div[style*="color:#b45309"],
.deposit-show-page div[style*="color: #b45309"] {
    color: var(--accent-amber) !important;
}

.related-panel,
.related-panel .ttable {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--glass-border) !important;
    color: var(--foreground);
}

.related-panel h5 {
    border-bottom-color: var(--border);
    color: var(--accent-amber);
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--glass-border);
    color: var(--foreground);
}

.modal-header,
.modal-body,
.modal-footer {
    border-color: var(--border);
}

.btn-close {
    filter: invert(1) grayscale(1);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-foreground);
    border-color: var(--border);
    opacity: 1;
}

/* Document show - form rows */
.doc-form-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.doc-form-row-three-cols {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.doc-form-row-three-cols .col-f {
    flex: 0 0 33.33%;
    max-width: 33.33%;
}

.doc-form-row-two-cols {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.doc-form-row-two-cols .col-f {
    flex: 0 0 50%;
    max-width: 50%;
}

.doc-form-row-single {
    margin-bottom: 6px;
}

.doc-form-row-comment {
    margin-bottom: 8px;
}

/* Client search results dropdown */
.client-search-results {
    display: none;
    max-height: 180px;
    overflow-y: auto;
    position: absolute;
    z-index: 1000;
    width: calc(100% - 12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.client-search-results.is-open {
    display: block;
}

/* Selected client details */
.selected-client-details {
    font-size: 0.85rem;
}

.selected-client-details--filled {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.selected-client-details--empty {
    /* inherits alert-warning styles */
    font-size: 0.85rem;
}

/* Goods search container */
.goods-search-container {
    position: relative;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}

.goods-search-row {
    display: flex;
    gap: 4px;
}

.goods-search-row input {
    flex: 1;
}

.goods-search-results {
    display: none;
    position: absolute;
    z-index: 1000;
    width: calc(100% - 16px);
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.goods-search-results.is-open {
    display: block;
}

/* Goods table header */
.goods-table-header {
    background: rgba(255, 255, 255, 0.07);
    color: var(--foreground);
}

.goods-table-col-code {
    width: 60px;
}

.goods-table-col-qty {
    width: 60px;
}

.goods-table-col-price {
    width: 70px;
}

.goods-table-col-sum {
    width: 70px;
}

.goods-table-col-actions {
    width: 36px;
}

#goodsTable input[readonly] {
    width: 55px;
}

#goodsTable .input-group-sm {
    width: 130px;
}

#goodsTable .goods-count {
    width: 60px;
    text-align: center;
}

#goodsTable .btn-qty-decrease,
#goodsTable .btn-qty-increase {
    padding: 2px 6px;
    font-size: 0.9rem;
    line-height: 1;
}

#goodsTable .remove-btn {
    padding: 1px 6px;
    font-size: 0.8rem;
}

/* Document sum box */
.doc-sum-box {
    width: 30%;
    margin-left: auto;
}

.doc-sum-box-inner {
    padding: 8px;
    background: rgba(251, 191, 36, 0.08);
    border: 2px solid var(--accent-amber-border);
    border-radius: 6px;
    width: 100%;
}

.doc-sum-box-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-amber);
    margin-bottom: 4px;
}

.doc-sum-box-input {
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 10px;
    height: auto;
}

/* Post checkbox */
.post-checkbox {
    margin: 0 4px 0 0;
}

.post-checkbox-label {
    font-size: 0.85rem;
}

/* Goods title */
.goods-title {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

/* Delete form hidden */
.delete-form {
    display: none;
}

/* Document tabs (panel) */
.doc-tabs-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 2px;
}

.doc-tabs {
    display: inline-flex;
    align-items: stretch;
    gap: 8px;
    min-width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.doc-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--muted-foreground, #94a3b8);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border-radius: 12px 12px 0 0;
}

.doc-tab:hover {
    color: var(--foreground, #ffffff);
    background: rgba(255, 255, 255, 0.04);
}

.doc-tab.is-active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
}

.doc-tab__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
}

.doc-tab__label {
    font-weight: 600;
    line-height: 1.2;
}

/* ============================================================
   Document show — Mobile responsive (dark theme)
   font-size: 16px on inputs/selects prevents iOS Safari zoom
   ============================================================ */
@media (max-width: 767px) {
    .doc-page {
        padding: 8px 10px;
    }

    /* Stack layout vertically on mobile */
    .doc-layout {
        flex-direction: column;
    }

    .doc-related-col {
        width: 100%;
        position: static;
    }

    /* Larger, touch-friendly inputs — 16px prevents iOS auto-zoom on focus */
    .compact-form .form-control,
    .compact-form .form-select,
    .compact-form .input-group .form-control,
    .compact-form .client-search-row input,
    .goods-search-row input,
    .goods-search-row .form-control,
    #goodsTable .form-control,
    #goodsTable .form-control-sm,
    #goodsTable .goods-count,
    #goodsTable .goods-price,
    #goodsTable .goods-sum,
    .doc-sum-box-input {
        font-size: 16px !important;
        height: 44px;
        padding: 8px 10px;
    }

    /* Keep input-group buttons the same height */
    .compact-form .input-group .btn,
    .compact-form .client-search-row button,
    #goodsTable .btn-qty-decrease,
    #goodsTable .btn-qty-increase {
        font-size: 15px;
        padding: 8px 10px;
        height: 44px;
    }

    /* Compact form labels slightly larger */
    .compact-form label {
        font-size: 0.82rem;
    }

    /* Three-column rows become full-width stacked on mobile */
    .doc-form-row-three-cols {
        flex-wrap: wrap;
    }

    .doc-form-row-three-cols .col-f {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Two-column rows become stacked on narrow mobile */
    .doc-form-row-two-cols {
        flex-wrap: wrap;
    }

    .doc-form-row-two-cols .col-f {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Goods search row */
    .goods-search-row {
        flex-wrap: wrap;
    }

    .goods-search-row input {
        flex: 1 1 100%;
    }

    /* Goods table — horizontal scroll on very narrow */
    #goodsTable {
        font-size: 0.82rem;
    }

    #goodsTable th,
    #goodsTable td {
        padding: 6px 4px !important;
    }

    /* Sum box full width on mobile */
    .doc-sum-box {
        width: 100%;
    }

    /* Action buttons row */
    .doc-actions {
        flex-wrap: wrap;
    }

    .doc-actions .btn {
        flex: 1 1 auto;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
}

/* Client list - desktop default */
.client-list--mobile {
    display: none;
}

.client-table--desktop {
    display: block;
}

/* Money list - desktop default */
.money-list--mobile {
    display: none;
}

.money-table--desktop {
    display: block;
}

/* Deposit list - desktop default */
.deposit-list--mobile {
    display: none;
}

.deposit-table--desktop {
    display: block;
}

@media (max-width: 992px) {
    .doc-layout {
        flex-direction: column;
    }

    .doc-related-col {
        width: 100%;
        position: static;
    }
}

@media (max-width: 721px) {
    .top-action-bar {
        flex-wrap: wrap;
    }

    /* Mobile: switch to card layout without horizontal scroll */
    .document-compact-wrap {
        overflow: visible;
    }

    .document-compact-list {
        overflow-x: visible;
    }

    .document-compact-wrap .txtbox-price-docs {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.85rem;
        position: relative;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .document-compact-wrap.zakaz .txtbox-price-docs,
    .txtbox-price-docs.zakaz {
        min-width: 0;
    }

    /* Row 1: Order number + Date/Time on same line */
    .document-compact-wrap .order-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .document-compact-wrap .numdoc-docs {
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 0.35rem;
        order: 0;
    }

    .document-compact-wrap .numdoc-docs a {
        font-size: 1.1rem;
        font-weight: 700;
    }

    /* Show mobile icons, hide desktop icons */
    .document-compact-wrap .status-docs-icons {
        display: none;
    }

    .document-compact-wrap .status-docs-icons--mobile {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        flex-shrink: 0;
        order: 0;
    }

    .document-compact-wrap .status-docs-icons--mobile img.status-icon {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

    .document-compact-wrap .status-docs4.compact-date {
        order: 1;
        white-space: normal;
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.6);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1 1 auto;
    }

    .document-compact-wrap .compact-date-line {
        display: inline-block;
    }

    /* Row 2: Client data - centered */
    .document-compact-wrap .captionbox-docs {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        text-align: center;
    }

    .document-compact-wrap .captionbox-docs a {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .document-compact-wrap .compact-client-line,
    .document-compact-wrap .phone {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .document-compact-wrap .compact-client-line.compact-main {
        font-size: 0.95rem;
        font-weight: 600;
    }

    .document-compact-wrap .compact-client-line.city {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.65);
    }

    .document-compact-wrap .phone {
        font-size: 0.88rem;
    }

    /* Row 3: Order sum - centered */
    .document-compact-wrap .pricebox-docs1 {
        text-align: center;
    }

    .document-compact-wrap .pricebox-docs1 .money {
        font-size: 1.2rem;
        font-weight: 700;
    }

    /* Row 4: Note/content */
    .document-compact-wrap .captionbox-docs2 {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 0.82rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        text-align: center;
    }

    /* Row 5: Order status */
    .document-compact-wrap .status-docs3 {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        text-align: center;
        padding: 0.6rem 0.75rem;
        border-radius: 0.5rem;
        font-size: 0.88rem;
        font-weight: 600;
        margin-top: 0.25rem;
    }

    /* Client info panel (zakaz) */
    .document-compact-wrap .status-docs4:not(.compact-date) {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 0.82rem;
        text-align: center;
    }

    /* Hide line breaks in mobile */
    .document-compact-wrap .captionbox-docs a br,
    .document-compact-wrap .captionbox-docs2 br,
    .document-compact-wrap .status-docs4 br {
        display: none;
    }

    .doc-tabs {
        display: flex;
        align-items: stretch;
        gap: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    /* Goods table mobile: card-based layout without horizontal scroll */
    #goodsTable {
        display: block;
        overflow-x: visible;
    }

    #goodsTable thead {
        display: none;
    }

    #goodsTable tbody {
        display: block;
    }

    #goodsTable tr {
        display: block;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0.5rem;
    }

    #goodsTable td {
        display: block;
        padding: 0.4rem 0 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Goods code */
    #goodsTable td:first-child {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #goodsTable td:first-child input[readonly] {
        width: auto;
        flex: 0 0 auto;
        font-size: 0.82rem;
        padding: 2px 6px;
    }

    /* Goods name */
    #goodsTable td:nth-child(2) input[readonly] {
        width: 100%;
        font-size: 0.88rem;
        font-weight: 500;
        background: transparent;
        border: none;
        padding: 0;
    }

    /* Quantity, Price, Sum in one row on mobile */
    #goodsTable tr td:nth-child(3),
    #goodsTable tr td:nth-child(4),
    #goodsTable tr td:nth-child(5) {
        display: inline-block;
        vertical-align: middle;
        padding: 0.3rem 0.25rem !important;
        white-space: nowrap;
    }

    /* Quantity column */
    #goodsTable td:nth-child(3) {
        width: 100%;
    }

    #goodsTable td:nth-child(3) .input-group-sm {
        width: 100%;
        max-width: 140px;
    }

    #goodsTable .goods-count {
        width: 60px;
        text-align: center;
        font-size: 0.85rem;
    }

    #goodsTable .btn-qty-decrease,
    #goodsTable .btn-qty-increase {
        padding: 4px 6px;
        font-size: 0.95rem;
    }

    /* Price column */
    #goodsTable td:nth-child(4) {
        width: 50%;
    }

    #goodsTable td:nth-child(4)::before {
        content: 'Ціна:';
        display: block;
        font-size: 0.72rem;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 2px;
    }

    /* Sum column */
    #goodsTable td:nth-child(5) {
        width: 48%;
    }

    #goodsTable td:nth-child(5)::before {
        content: 'Сума:';
        display: block;
        font-size: 0.72rem;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 2px;
    }

    #goodsTable .goods-price,
    #goodsTable .goods-sum {
        width: 100%;
        font-size: 0.85rem;
        padding: 3px 6px;
    }

    /* Delete button */
    #goodsTable td:last-child {
        text-align: right !important;
        padding-top: 0.5rem !important;
    }

    #goodsTable .remove-btn {
        padding: 4px 10px;
        font-size: 0.85rem;
    }

    /* Empty row */
    #emptyGoodsRow td {
        text-align: center !important;
        font-size: 0.88rem;
        padding: 1rem 0 !important;
    }

    /* Document sum box mobile */
    .doc-sum-box {
        width: 100%;
        margin-left: 0;
    }

    .doc-sum-box-inner {
        background: rgba(240, 247, 255, 0.08);
        border: 2px solid rgba(13, 110, 253, 0.5);
    }

    .doc-sum-box-label {
        color: rgba(13, 110, 253, 0.9);
    }

    .doc-sum-box-input {
        font-size: 1.1rem;
        padding: 8px 12px;
    }

    /* Action buttons mobile */
    .doc-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .doc-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
        font-size: 0.85rem;
        padding: 8px 12px;
        text-align: center;
    }

    /* Form inputs mobile */
    .compact-form .form-control,
    .compact-form .form-select {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .compact-form .client-search-row {
        flex-direction: row;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }

    .compact-form .client-search-row input {
        flex: 0 0 80%;
        max-width: 80%;
        min-width: 0;
    }

    .compact-form .client-search-row button {
        flex: 0 0 10%;
        min-width: 0;
        padding: 6px 4px;
        font-size: 0.85rem;
    }

    @media (max-width: 480px) {
        .compact-form .client-search-row {
            gap: 0.3rem;
        }

        .compact-form .client-search-row button {
            padding: 6px 2px;
            font-size: 0.75rem;
        }
    }

    .client-search-results {
        width: 100% !important;
        position: relative !important;
        margin-top: 0.5rem;
    }

    /* Goods search mobile */
    .goods-search-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .goods-search-results {
        width: 100% !important;
        position: relative !important;
        margin-top: 0.5rem;
    }

    /* Hide desktop client table */
    .client-table--desktop {
        display: none;
    }

    /* Client card layout */
    .client-list--mobile {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .client-card {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--glass-backdrop-blur));
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
        padding: 1rem;
        transition: all 0.2s ease;
    }

    .client-card:hover {
        border-color: var(--accent-amber-border);
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.08);
    }

    .client-card--empty {
        text-align: center;
        padding: 2rem;
    }

    .client-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .client-card__org {
        color: var(--accent-amber);
        font-weight: 600;
        font-size: 1.05rem;
        text-decoration: none;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .client-card__org:hover {
        color: var(--accent-amber-dark);
        text-decoration: underline;
    }

    .client-card__id {
        color: #d1d5db;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .client-card__name {
        color: var(--foreground);
        font-size: 0.95rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    .client-card__info {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        font-size: 0.88rem;
        color: #d1d5db;
        margin-bottom: 0.75rem;
    }

    .client-card__phone,
    .client-card__city {
        white-space: nowrap;
    }

    .client-card__actions {
        display: flex;
        justify-content: center;
    }

    .client-card__actions .btn {
        width: 100%;
        max-width: 200px;
    }

    /* Hide desktop money table */
    .money-table--desktop {
        display: none;
    }

    /* Money card layout */
    .money-list--mobile {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .money-card {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--glass-backdrop-blur));
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
        padding: 1rem;
        transition: all 0.2s ease;
        position: relative;
    }

    .money-card--income {
        border-left: 3px solid #22c55e;
    }

    .money-card--outcome {
        border-left: 3px solid #ef4444;
    }

    .money-card:hover {
        border-color: var(--accent-amber-border);
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.08);
    }

    .money-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .money-card__type {
        font-weight: 700;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .money-card--income .money-card__type {
        color: #22c55e;
    }

    .money-card--outcome .money-card__type {
        color: #ef4444;
    }

    .money-card__num {
        color: #d1d5db;
        font-size: 0.82rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .money-card__posted {
        flex-shrink: 0;
    }

    .money-card__date {
        color: #d1d5db;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .money-card__client {
        color: var(--foreground);
        font-size: 0.92rem;
        font-weight: 500;
        margin-bottom: 0.4rem;
    }

    .money-card__client small {
        color: #d1d5db;
        font-size: 0.82rem;
    }

    .money-card__cashbox {
        color: #d1d5db;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .money-card__sum {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .money-card__sum--income {
        color: #22c55e;
    }

    .money-card__sum--outcome {
        color: #ef4444;
    }

    .money-card__comment {
        color: var(--muted-foreground);
        font-size: 0.82rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        margin-bottom: 0.5rem;
        word-break: break-word;
    }

    .money-card__actions {
        display: flex;
        justify-content: center;
    }

    .money-card__actions .btn {
        width: 100%;
        max-width: 200px;
    }

    /* Hide desktop deposit table */
    .deposit-table--desktop {
        display: none;
    }

    /* Deposit card layout */
    .deposit-list--mobile {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .deposit-card {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--glass-backdrop-blur));
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
        padding: 1rem;
        transition: all 0.2s ease;
        position: relative;
    }

    .deposit-card--topup {
        border-left: 3px solid #22c55e;
    }

    .deposit-card--withdraw {
        border-left: 3px solid #ef4444;
    }

    .deposit-card--exchange {
        border-left: 3px solid #f59e0b;
    }

    .deposit-card:hover {
        border-color: var(--accent-amber-border);
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.08);
    }

    .deposit-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .deposit-card__type {
        font-weight: 700;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .deposit-card--topup .deposit-card__type {
        color: #22c55e;
    }

    .deposit-card--withdraw .deposit-card__type {
        color: #ef4444;
    }

    .deposit-card--exchange .deposit-card__type {
        color: #f59e0b;
    }

    .deposit-card__num {
        color: #d1d5db;
        font-size: 0.82rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .deposit-card__posted {
        flex-shrink: 0;
    }

    .deposit-card__date {
        color: #d1d5db;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .deposit-card__route {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .deposit-card__from,
    .deposit-card__to {
        color: var(--foreground);
        font-weight: 500;
    }

    .deposit-card__arrow {
        color: var(--accent-amber);
        font-weight: 700;
    }

    .deposit-card__sum {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent-amber);
        margin-bottom: 0.5rem;
    }

    .deposit-card__comment {
        color: var(--muted-foreground);
        font-size: 0.82rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        margin-bottom: 0.5rem;
        word-break: break-word;
    }

    .deposit-card__actions {
        display: flex;
        justify-content: center;
    }

    .deposit-card__actions .btn {
        width: 100%;
        max-width: 200px;
    }

    /* Empty state */
    .deposit-empty {
        text-align: center;
        padding: 2rem;
        color: #CC0000;
    }

    /* ==================== Goods Mobile Cards ==================== */
    .goods-mobile-grid {
        display: grid !important;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .goods-mobile-card {
        background: var(--card, #ffffff);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .goods-mobile-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    }

    .goods-mobile-card-link {
        text-decoration: none;
        color: inherit;
        display: block;
    }

    .goods-mobile-image {
        width: 100%;
        height: 180px;
        overflow: hidden;
        background: var(--muted, #f8f9fa);
        position: relative;
    }

    .goods-mobile-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .goods-mobile-content {
        padding: 0.875rem;
    }

    .goods-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .goods-mobile-name {
        font-size: 1rem;
        font-weight: 600;
        color: var(--foreground, #212529);
        margin: 0;
        line-height: 1.3;
        flex: 1;
    }

    .goods-stock-badge {
        padding: 0.25rem 0.625rem;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 500;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .goods-stock-badge.in-stock {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .goods-stock-badge.out-of-stock {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
    }

    .goods-mobile-prices {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        background: var(--muted, #f8f9fa);
        border-radius: 8px;
    }

    .goods-price-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .goods-price-item.old-price {
        opacity: 0.7;
    }

    .goods-price-item.old-price .price-value {
        text-decoration: line-through;
        color: #6c757d;
    }

    .price-label {
        font-size: 0.8125rem;
        color: var(--muted-foreground, #6c757d);
        font-weight: 500;
    }

    .price-value {
        font-size: 1rem;
        font-weight: 700;
        color: var(--foreground, #212529);
    }

    .goods-mobile-meta {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }

    .meta-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.375rem 0;
        border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    }

    .meta-item:last-child {
        border-bottom: none;
    }

    .meta-label {
        font-size: 0.8125rem;
        color: var(--muted-foreground, #6c757d);
        font-weight: 500;
    }

    .meta-value {
        font-size: 0.875rem;
        color: var(--foreground, #212529);
        font-weight: 600;
        text-align: right;
    }

    .goods-mobile-empty {
        text-align: center;
        padding: 3rem 1rem;
        color: var(--muted-foreground, #6c757d);
    }

    .goods-mobile-empty p {
        font-size: 1rem;
        margin: 0;
    }
}

/* Desktop/Tablet: Show table, hide mobile cards */
@media (min-width: 769px) {
    .goods-mobile-grid {
        display: none !important;
    }
    
    .goods-desktop-table {
        display: block !important;
    }
}

/* Mobile: Hide table, show mobile cards */
@media (max-width: 768px) {
    .goods-desktop-table {
        display: none !important;
    }

    .goods-mobile-grid {
        display: grid !important;
    }

    .doc-form-row-two-cols {
        flex-direction: column !important;
        gap: 4px !important;
    }

    .doc-form-row-two-cols .col-f {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ==================== Goods Index Dark Table ==================== */
.goods-index-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.9rem;
    background: transparent;
}

.goods-index-table thead tr {
    background: linear-gradient(135deg, rgba(251,191,36,0.15) 0%, rgba(245,158,11,0.08) 100%);
    border-bottom: 2px solid rgba(251,191,36,0.35);
}

.goods-index-table thead th {
    padding: 10px 14px;
    color: rgba(251,191,36,0.95);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: none;
}

.goods-index-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s ease;
}

.goods-index-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.025);
}

.goods-index-table tbody tr:hover {
    background: rgba(251,191,36,0.06);
    border-bottom-color: rgba(251,191,36,0.2);
}

.goods-index-table tbody td {
    padding: 9px 14px;
    color: var(--foreground, #e2e8f0);
    vertical-align: middle;
    border: none;
}

/* ID column */
.goods-index-table tbody td:first-child {
    color: var(--muted-foreground, rgba(255,255,255,0.5));
    font-size: 0.82rem;
    white-space: nowrap;
}

.goods-index-table tbody td:first-child a {
    color: rgba(251,191,36,0.8);
    text-decoration: none;
    font-weight: 600;
}

.goods-index-table tbody td:first-child a:hover {
    color: #fbbf24;
    text-decoration: underline;
}

/* Name column */
.goods-index-table tbody td:nth-child(3) a {
    color: var(--foreground, #e2e8f0);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.goods-index-table tbody td:nth-child(3) a:hover {
    color: #fbbf24;
}

/* Image column */
.goods-index-table tbody td:nth-child(2) {
    text-align: center;
    padding: 6px 10px;
}

.goods-index-table tbody td:nth-child(2) img {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.goods-index-table tbody td:nth-child(2) img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Price columns */
.goods-index-table tbody td:nth-child(4),
.goods-index-table tbody td:nth-child(5),
.goods-index-table tbody td:nth-child(6) {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    color: #e2e8f0;
}

/* Old price — muted */
.goods-index-table tbody td:nth-child(6) {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    text-decoration: line-through;
}

/* Count column */
.goods-index-table tbody td:nth-child(7) {
    white-space: nowrap;
    color: #a3e635;
    font-weight: 600;
    font-size: 0.88rem;
}

/* Empty row */
.goods-index-table tbody td[colspan] {
    text-align: center;
    padding: 2rem;
    color: var(--muted-foreground, rgba(255,255,255,0.4));
    font-size: 0.95rem;
    background: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLIENT INDEX — Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* Desktop table: override Bootstrap defaults */
.client-table--desktop .table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.9rem;
    background: transparent;
    color: var(--foreground);
    border: none;
}

.client-table--desktop .table thead.table-dark,
.client-table--desktop .table thead {
    background: linear-gradient(135deg, rgba(251,191,36,0.15) 0%, rgba(245,158,11,0.08) 100%) !important;
    border-bottom: 2px solid rgba(251,191,36,0.35);
}

.client-table--desktop .table thead th {
    padding: 10px 14px;
    color: rgba(251,191,36,0.95) !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: none !important;
    background: transparent !important;
}

.client-table--desktop .table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s ease;
}

.client-table--desktop .table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.025);
}

.client-table--desktop .table tbody tr:hover {
    background: rgba(251,191,36,0.06);
    border-bottom-color: rgba(251,191,36,0.2);
}

.client-table--desktop .table tbody td {
    padding: 9px 14px;
    color: var(--foreground);
    vertical-align: middle;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

/* ID column */
.client-table--desktop .table tbody td:first-child {
    color: var(--muted-foreground);
    font-size: 0.82rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Organization link */
.client-table--desktop .table tbody td:nth-child(2) a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.client-table--desktop .table tbody td:nth-child(2) a:hover {
    color: #fbbf24;
}

/* Contact name */
.client-table--desktop .table tbody td:nth-child(3) {
    color: var(--muted-foreground);
    font-size: 0.88rem;
}

/* Phone */
.client-table--desktop .table tbody td:nth-child(4) {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--foreground);
    font-size: 0.88rem;
}

/* City */
.client-table--desktop .table tbody td:nth-child(5) {
    color: var(--muted-foreground);
    font-size: 0.88rem;
}

/* Orders button */
.client-table--desktop .client-orders-btn {
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.3);
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.client-table--desktop .client-orders-btn:hover {
    background: rgba(251,191,36,0.2);
    border-color: rgba(251,191,36,0.5);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(251,191,36,0.15);
}

/* Empty row */
.client-table--desktop .table tbody td[colspan] {
    text-align: center;
    padding: 2rem;
    color: var(--muted-foreground);
    font-size: 0.95rem;
    background: transparent;
}

/* ── Client Orders Modal (Bootstrap override) ──────────────────────────── */
#clientOrdersModal .modal-content {
    background: rgba(15,17,26,0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    color: var(--foreground);
}

#clientOrdersModal .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 16px 20px;
}

#clientOrdersModal .modal-title {
    font-family: var(--header);
    font-weight: 600;
    color: var(--foreground);
    font-size: 1.1rem;
}

#clientOrdersModal .btn-close {
    filter: invert(1) brightness(0.8);
}

#clientOrdersModal .modal-body {
    padding: 16px 20px;
}

#clientOrdersModal .table {
    background: transparent;
    color: var(--foreground);
    border: none;
}

#clientOrdersModal .table thead th {
    color: rgba(251,191,36,0.85);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    border-bottom: 1px solid rgba(251,191,36,0.2);
    padding: 8px 12px;
    background: transparent;
}

#clientOrdersModal .table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#clientOrdersModal .table tbody tr:hover {
    background: rgba(251,191,36,0.04);
}

#clientOrdersModal .table tbody td {
    border: none;
    padding: 8px 12px;
    color: var(--foreground);
    vertical-align: middle;
}

#clientOrdersModal .table tbody td a {
    color: #fbbf24;
    font-weight: 600;
    text-decoration: none;
}

#clientOrdersModal .table tbody td a:hover {
    text-decoration: underline;
}

/* ── Client filter active notice ───────────────────────────────────────── */
.container .alert-warning {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.3);
    color: rgba(251,191,36,0.9);
    border-radius: var(--radius);
    font-size: 0.88rem;
}

.container .alert-warning a {
    color: #fbbf24;
    font-weight: 600;
    text-decoration: underline;
}

.container .alert-warning a:hover {
    color: #f59e0b;
}

/* ── Money Summary — mobile: compact single row ────────────────────────── */
@media (max-width: 768px) {
    .money-summary {
        gap: 6px;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }

    .money-summary__card {
        min-width: 0;
        padding: 8px 6px !important;
        border-radius: 10px !important;
    }

    .money-summary__icon {
        display: none;
    }

    .money-summary__label {
        font-size: 0.62rem;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        margin-bottom: 2px;
        opacity: 0.7;
    }

    .money-summary__value {
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.2;
    }
}
