/* ==========================================================================
   pyerp Enterprise Resource Planning - Global Stylesheet
   ========================================================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #18bc9c;
    --accent-color: #3498db;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #f8f9fa;
    --border-color: #dce4ec;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
}

/* Global Reset & Compact Typography (-1px) */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: 15px; /* Compact font size base */
    line-height: 1.4;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    background-color: #eaeff2;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Maximized Fluid Layout with Minimal Lateral Padding */
.container, main, .content-wrapper {
    width: 98%;              /* Expanded edge-to-edge window workspace */
    max-width: 1800px;        /* Increased ceiling for widescreen displays */
    margin: 0 auto;
    padding: 1rem 0.5rem;    /* Reduced margins from screen edges */
}

/* ==========================================================================
   Modern Minimalist ERP Navbar Styling
   ========================================================================== */
.navbar {
    background-color: #1a252f; /* Deep corporate midnight dark blue */
    color: #ffffff;
    padding: 0 1.5rem;         /* Zero vertical padding for maximum screen height */
    height: 44px;              /* Fixed low-profile height to maximize workspace */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    white-space: nowrap;       /* Zabraňuje zalamování celého obsahu navbaru */
}

.navbar-brand {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #18bc9c !important; /* Brand secondary emerald accent color */
    margin-right: 2rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;            /* Zabranuje smršťování loga */
}

.navbar-left-container {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;
}

.navbar-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    height: 100%;
    overflow-x: auto;          /* Při nedostatku místa umožní horizontální posun */
    scrollbar-width: none;    /* Skryje scrollbar ve Firefoxu */
}

.navbar-menu::-webkit-scrollbar {
    display: none;             /* Skryje scrollbar v Chrome/Safari */
}

.navbar-item {
    color: #adb5bd;            /* Soft muted text state color */
    font-size: 13px;           /* Crisp clean text sizing */
    font-weight: 500;
    padding: 0 0.85rem;
    height: 44px;              /* Fills the entire vertical bar height */
    display: flex;
    align-items: center;
    transition: all 0.15s ease-in-out;
    border-bottom: 3px solid transparent; /* Bottom marker placeholder */
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

/* Active module state marker (underlined border like SAP / Microsoft) */
.navbar-item.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 3px solid var(--secondary-color);
    font-weight: 600;
}

.navbar-right {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    font-size: 13px;
    color: #ced4da;
    white-space: nowrap;
    flex-shrink: 0;            /* Pravá část zůstane vždy celá viditelná */
}

.navbar-user-token {
    font-weight: 600;
    color: #ffffff;
}

.navbar-logout-link {
    color: #e74c3c;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
    white-space: nowrap;
}

.navbar-logout-link:hover {
    background-color: rgba(231, 76, 60, 0.1);
    text-decoration: none;
}

/* Language Switcher Dropdown */
.lang-switcher {
    display: flex;
    align-items: center;
    padding-right: 0.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-select {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.lang-select:hover,
.lang-select:focus {
    border-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.14);
}

.lang-select option {
    background-color: #1a252f;
    color: #ffffff;
}

.tenant-switcher {
    display: flex;
    align-items: center;
    padding-right: 0.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.tenant-select {
    max-width: 180px;
    text-overflow: ellipsis;
    border-color: rgba(24, 188, 156, 0.45);
}

.tenant-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    padding-right: 0.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* High-Density Card Containers */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;        /* Tightened internal card spacers */
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    width: 100%;
}

/* ERP Compact Dense Data Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 14px;         /* Decreased table data font */
}

th {
    background-color: #f1f4f6;
    color: var(--primary-color);
    font-weight: bold;
    border-bottom: 2px solid var(--border-color);
    padding: 0.4rem 0.5rem;  /* Tightened padding for row compression */
    text-align: left;
}

td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 0.5rem;  /* Tight vertical row padding */
    vertical-align: middle;
}

tr:hover td {
    background-color: #fafdff;
}

/* Compact Forms & UI Inputs */
.form-group {
    margin-bottom: 0.75rem;  /* Dense form stack layout */
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 13.5px;
    color: #34495e;
}

.form-control {
    width: 100%;
    padding: 0.4rem 0.5rem;  /* Compact inner text control box padding */
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-color);
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

select.form-control {
    height: 32px;
    padding-top: 2px;
    padding-bottom: 2px;
}

textarea.form-control {
    height: auto;
    resize: vertical;
}

/* Buttons System */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.4rem 1rem;    /* Streamlined utility button sizing */
    font-size: 14px;
    border-radius: 4px;
    color: white;
    background-color: var(--accent-color);
    cursor: pointer;
    transition: opacity 0.15s ease-in-out;
    width: 100%;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-sm, td .btn {
    width: auto;
    padding: 0.25rem 0.6rem;
    font-size: 13px;
}

/* Toast Notifications / Flash Messages */
.alert {
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Grid Layout Systems for Dashboards */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.25rem;
}

.grid-1-3 {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-1-2, .grid-1-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ERP Module Sub-Tabs & Pagination Bar
   ========================================================================== */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.erp-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.25rem;
    gap: 0.25rem;
}

.erp-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 0.55rem 1.1rem;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.erp-tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(44, 62, 80, 0.04);
}

.erp-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
}

.erp-tab-pane {
    display: none;
}

.erp-tab-pane.active {
    display: block;
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 13.5px;
    color: #6c757d;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-links {
    display: flex;
    gap: 0.25rem;
}

.page-link {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.page-link:hover {
    background-color: #f1f4f6;
    text-decoration: none;
}

.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}