@media print {
  @page {
    size: 62mm auto;
    margin: 0;
  }
  body, html {
    width: 62mm !important;
    min-width: 62mm !important;
    max-width: 62mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
  }
  /* Ukryj wszystko poza podglądem etykiety */
  body > *:not(.print-label-preview),
  body > :not(.print-label-preview) * {
    display: none !important;
    visibility: hidden !important;
  }
  .print-label-preview {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    margin: 0 !important;
    width: 62mm !important;
    min-width: 62mm !important;
    max-width: 62mm !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif !important;
  }
}

/* Make the H/EUH phrase search input full width and visually consistent */
#phrase_search {
    width: 100%;
    min-width: 220px;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 0.6em;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
}
/* Sticky label preview at the top of the form page */
.label-preview-sticky {
    position: sticky;
    top: 84px;
    z-index: 20;
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 22px 0;
}

.preview-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}

.preview-print-mode-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.14em 0.58em;
    font-size: 0.74rem;
    line-height: 1.2;
    font-weight: 600;
    color: #4a4a4a;
    background: #fff;
}
/* Gap between input and button in the search form on start_label.html */
#search-form input[type="text"] {
    margin-bottom: 14px;
}
#search-form .btn-primary {
    margin-top: 4px;
}
/* Ensure white background between form fields in frames */
.form-frame {
    background: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    padding: 22px !important;
}
.form-frame > div,
.form-frame > label,
.form-frame > select,
.form-frame > input {
    background: #fff !important;
    border-radius: 6px;
}
/* Centered text utility */
.center-text {
    text-align: center;
}
/* Hamburger menu styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    margin-left: auto;
    z-index: 101;
}
.hamburger span {
    height: 4px;
    width: 100%;
    background: var(--main-color);
    margin: 4px 0;
    border-radius: 2px;
    transition: 0.3s;
}

@media (max-width: 700px) {
    .hamburger {
        display: flex;
    }
    .header-right {
        display: none !important;
        flex-direction: column;
        background: var(--header-bg);
        position: absolute;
        top: 60px;
        right: 0;
        width: 100vw;
        box-shadow: var(--shadow);
        padding: 1em 0.5em;
        z-index: 100;
    }
    .header-right.active {
        display: flex !important;
    }
    header {
        position: relative;
    }
}
:root {
    --main-bg: #f4f4f4;
    --main-color: #595959;
    --admin-color: #ff8c00;
    --accent: #00cbcc;
    --accent-hover: #1565c0;
    --danger: #e53935;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.07);
    --header-bg: #f4f4f4d2;
}

body {
    background: var(--main-bg);
    color: var(--main-color);
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

header {
    background: var(--header-bg);
    color: #222;
    box-shadow: var(--shadow);
    padding: 0.7rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 40px;
}

.admin-panel-title {
    display: inline-block;
    vertical-align: middle;
    margin-left: 12px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--admin-color);
    letter-spacing: 0.2px;
}

.header-left {
    display: flex;
    align-items: center;
}

.brand-link {
    color: #222 !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.7em;
}

.user-info {
    color: var(--main-color);
    margin: 0 0.7em;
    font-size: 1rem;
}

.user-menu {
    position: relative;
    margin-left: 0.2em;
}

.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: #fff;
    color: var(--accent-hover);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.avatar-btn:hover {
    background: var(--accent);
    color: #fff;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: none;
    z-index: 120;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #555;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 6px;
}

.user-dropdown a,
.user-dropdown-logout {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--main-color);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

.user-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.user-dropdown-icon {
    font-size: 19px;
    line-height: 1;
    color: #607d8b;
}

.user-dropdown a:hover,
.user-dropdown-logout:hover {
    background: #f3f7fb;
    color: var(--accent-hover);
    text-decoration: none;
}

.user-dropdown a:focus,
.user-dropdown-logout:focus {
    text-decoration: none;
}

.user-dropdown-logout-form {
    margin: 0;
    padding: 0;
    background: transparent;
}

.btn-admin {
    background: var(--admin-color);
    color: #fff;
    border: 1.5px solid var(--admin-color);
    border-radius: var(--radius);
    padding: 0.5em 1.0em;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-left: 8px;
    width: auto;
}
.btn-admin:hover {
    background: var(--header-bg);
    color: var(--admin-color);
    border: 1.5px solid var(--admin-color);
}
.btn-header-primary {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.5em 1.0em;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    width: auto;
}

.btn-header-primary:hover {
    background: var(--header-bg);
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-search-compact {
    padding: 0.42em 0.85em;
    min-width: 86px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.5em 1.2em;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.btn-primary:hover {
    background: #fff;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-logout {
    background: var(--danger);
    color: #fff;
    border: 1.5px solid var(--danger);
    border-radius: var(--radius);
    padding: 0.5em 1.2em;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.btn-logout:hover {
    background: var(--header-bg);
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

main {
    width: calc(100% - 32px);
    max-width: 1100px;
    margin: 2rem auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

main.inventory-main {
    max-width: 1240px;
    width: calc(100% - 32px);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.36rem;
    margin: 0 0 14px 2px;
    font-size: 0.82rem;
    color: #7b8792;
}

.breadcrumb-nav a {
    color: #7b8792;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

.breadcrumb-sep {
    color: #9aa4ad;
}

.breadcrumb-current {
    color: #5f6973;
    font-weight: 600;
}

/* Inventory pages aligned to the same card layout used on start_label.html */
.inventory-page {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto 32px auto;
    padding: 0;
}

.inventory-card {
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 24px;
}

.inventory-card + .inventory-card {
    margin-top: 24px;
}

.inventory-table-card {
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: auto;
}

.inventory-table-card + .inventory-table-card {
    margin-top: 24px;
}

@media (max-width: 900px) {
    main.inventory-main {
        max-width: 100%;
        width: calc(100% - 16px);
        margin: 1rem auto;
        padding: 1rem;
    }

    .inventory-page {
        max-width: 100%;
    }
}

form {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-radius: var(--radius);
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

label {
    font-weight: 500;
    margin-bottom: 0.2em;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
select {
    padding: 0.6em;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    transition: border 0.2s;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: var(--accent);
    outline: none;
}

input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--accent);
    margin-right: 0.5em;
}

img {
    vertical-align: middle;
    margin-right: 0.5em;
    border-radius: 4px;
    background: #f5f5f5;
}

h1, h2 {
    color: var(--main-color);
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    text-align: center;
}

h3 {
    color: var(--main-color);
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

h5 {
    color: var(--main-color);
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    text-align: center;
}

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

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

.footer-bar {
    background: var(--main-bg);
    color: var(--main-color);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8em;
    padding: 0.7em 0 0.5em 0;
    letter-spacing: 0.02em;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

.footer-bar a {
    text-decoration: none;
    color: var(--accent-hover);
    transition: color 0.2s;
}

.footer-bar a:hover {
    text-decoration: underline;
    color: var(--accent);
}

#sticky-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
    padding: 8px 10px;
    display: flex;
    gap: 0.6em;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    border-radius: 0;
    z-index: 100;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
}

.print-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.45em;
    flex-wrap: wrap;
}

.print-mode-title {
    font-weight: 700;
    color: var(--main-color);
    font-size: 0.92rem;
}

.print-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.34em 0.72em;
    font-size: 0.88rem;
    line-height: 1;
}

.print-mode-option input[type="radio"] {
    margin: 0 0.34em 0 0;
}

.sticky-actions-buttons {
    display: flex;
    gap: 0.5em;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sticky-actions-buttons .btn-primary {
    padding: 0.42em 0.95em;
    font-size: 0.93rem;
}

@media (max-width: 700px) {
    main {
        max-width: 98vw;
        padding: 1rem;
    }
    header {
        flex-direction: column;
        gap: 0.5em;
        padding: 0.7rem 1rem;
    }
    h1 {
        font-size: 1.3rem;
    }
    button, input, select {
        font-size: 1em;
    }
    .header-right {
        flex-direction: column;
        gap: 0.3em;
        width: 100%;
        align-items: flex-start;
    }
    .user-info {
        margin: 0.5em 0 0.5em 0;
    }
    .btn-header-primary, .btn-logout {
        width: 100%;
        box-sizing: border-box;
    }
    .user-menu {
        width: 100%;
    }
    .user-dropdown {
        left: 0;
        right: auto;
    }
    form {
        padding: 0.5em;
    }
    #sticky-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55em;
        padding: 8px;
    }
    .print-mode-bar {
        width: 100%;
        justify-content: flex-start;
    }
    .sticky-actions-buttons {
        width: 100%;
        justify-content: stretch;
    }
    .sticky-actions-buttons .btn-primary {
        flex: 1 1 auto;
    }
    img {
        max-width: 90vw !important;
        height: auto;
    }
}

@media (max-width: 400px) {
    main {
        padding: 0.3rem;
    }
    header {
        padding: 0.3rem 0.3rem;
    }
    .footer-bar {
        font-size: 0.7em;
        padding: 0.4em 0 0.3em 0;
    }
    h1, h2, h3 {
        font-size: 1em;
    }
    .btn-header-primary, .btn-primary, .btn-logout {
        font-size: 0.95em;
        padding: 0.4em 0.7em;
    }
    .header-left img {
        height: 18px !important;
    }
}

/* Indeksowe przyciski w legendzie sekcji danych identyfikacyjnych */
#btn-sub-all,
#btn-sup-all {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.25em 0.7em;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Segoe UI', 'Open Sans', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-left: 0.5em;
    transition: background 0.2s, color 0.2s, border 0.2s;
    vertical-align: middle;
}

#btn-sub-all:hover,
#btn-sup-all:hover {
    background: #fff;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

#suggestions li {
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
#suggestions li:last-child {
    margin-bottom: 0;
}
#suggestions li:hover {
    background: #e6f0fa;
}

/* Index page: dashboard and landing layout */
.index-page main {
    margin: 1.1rem auto 0.8rem auto;
    padding: 1.2rem;
}

.dashboard-shell {
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 4vh;
}

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

.dashboard-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--main-color);
}

.dashboard-subtitle {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 0.95rem;
}

.dashboard-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 16px;
    min-height: 118px;
    color: var(--main-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}

.dashboard-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.09);
    border-color: var(--accent);
    text-decoration: none;
}

.dashboard-tile:focus,
.dashboard-tile:active,
.dashboard-tile:visited {
    text-decoration: none;
}

.tile-icon {
    font-family: 'Material Symbols Outlined';
    font-size: 34px;
    line-height: 1;
    color: var(--accent-hover);
}

.tile-label {
    font-weight: 700;
    font-size: 1.04rem;
    color: var(--main-color);
}

.landing-shell {
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2vh;
    padding: 6px 0 8px;
}

.landing-logo {
    max-width: 300px;
    display: block;
    margin: 0 auto 6px auto;
    background: transparent;
}

.landing-intro {
    margin-bottom: 12px;
}

.landing-login-wrap {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 8px;
}

.landing-more {
    margin-top: 40px;
}

.landing-more-link {
    color: var(--accent);
    text-decoration: none;
}

.landing-more-link:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .index-page main {
        margin: 0.7rem auto 0.5rem auto;
        padding: 0.9rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 460px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Login page */
.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2vh;
    padding: 6px 0 8px;
}

.login-logo {
    max-width: 300px;
    display: block;
    margin: 0 auto 20px auto;
    background: transparent;
}

.login-intro {
    margin: 0 0 6px 0;
}

.login-error {
    color: #c62828;
    text-align: center;
}

.login-card {
    max-width: 600px;
    margin: 0 auto 32px auto;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 24px;
}

.login-form {
    max-width: 420px;
    margin: 0 auto;
}

.login-account {
    margin-top: 0;
    color: #444;
}

.login-terms-title {
    margin-top: 12px;
}

.login-terms-card {
    max-width: 700px;
    margin: 0 auto;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 24px;
}

.login-terms-body {
    font-size: 0.97em;
    color: #444;
    line-height: 1.6;
}

.login-terms-accept-wrap {
    margin: 18px 0;
}

.login-submit {
    width: 100%;
    margin-top: 10px;
}

.login-more {
    margin-top: 10px;
}

.login-more-link {
    color: var(--accent);
    text-decoration: none;
}

.login-more-link:hover {
    text-decoration: underline;
}