/* ==========================================================
   ERGOREST - Global & Central Portal Stylesheet (app.css)
   Used by root index.php, login.php, and global components
   ========================================================== */

:root {
    --blue: #032269;
    --yellow: #fdc300;
    --line: #dce3ed;
    --muted: #728096;
    --bg: #f4f6fa;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--blue);
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 19px;
    line-height: 1.4;
    margin-bottom: 18px;
}

/* Header / Brandbar */
.brandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px max(24px, calc((100vw - 1120px) / 2));
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brandbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.brandbar-left img {
    display: block;
    width: 164px;
    height: auto;
}

.brandbar-subtitle,
.brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--muted);
}

.brandbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-profile-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.user-icon {
    font-size: 16px;
    color: var(--blue);
}

.user-display-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
}

.user-role-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #e2e8f0;
    color: var(--blue);
}

.user-role-badge.role-admin {
    background: var(--yellow);
    color: var(--blue);
}


.warehouseBrand {
  max-width: none;
  margin: 0 auto;
  padding: 15px max(15px,calc((100% - 792px)/2));
  display: flex;
  align-items: center;
  border-bottom: 5px solid #fdc300;
  justify-content: space-between; 
  box-shadow: 0 4px 20px #03226918;
  gap: 20px;
  background: #032269;
}

#panel-warehouse {
    margin-top: 10px;
}

a.brand-portal-link {
    text-decoration: none;
}





/* Cards & Messages */
.card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    margin: 0 0 24px;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.form-message {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
}

.form-message.is-visible {
    display: block;
}

.form-message.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.form-message.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.form-message.warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    max-width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

.btn.primary,
.btn.yellow {
    background: var(--yellow);
    border-color: var(--yellow);
}

.btn.navy {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.btn.btn-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.btn.btn-logout {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 12px;
}

.btn.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.btn-full {
    width: 100%;
}

.btn:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.btn[disabled] {
    cursor: default;
    opacity: 0.5;
}

/* Form Elements */
label {
    display: block;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
}

input:not([type="radio"]),
select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 8px 0 0;
    padding: 12px;
    border: 1px solid #ccd6e4;
    border-radius: 9px;
    background: #fff;
    color: var(--blue);
    font-size: 16px;
    line-height: 1.35;
    min-height: 48px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #fdc30088;
    border-color: var(--blue);
}

/* Login Page (login.php) */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-main {
    width: 100%;
    max-width: 440px;
    padding: 0;
    margin: auto;
}

.login-card {
    margin: 0;
    padding: 32px 28px;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    text-align: center;
}

.login-logo {
    width: 180px;
    height: auto;
}

.login-title {
    font-size: 22px;
    text-align: center;
    margin-bottom: 20px;
}

.login-field-spacing {
    margin-top: 16px;
}

/* Root Portal Dashboard (index.php) */
.portal-body {
    background-color: #f3f6fb;
    min-height: 100vh;
}

.portal-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.portal-hero {
    text-align: center;
    margin-bottom: 36px;
}

.portal-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #032269;
    background: #e4ebf8;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.portal-title {
    font-size: 28px;
    font-weight: 700;
    color: #032269;
    margin: 0 0 8px;
}

.portal-subtitle {
    font-size: 14px;
    color: #5b6b82;
    margin: 0 auto;
    max-width: 600px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.portal-grid.single-module {
    grid-template-columns: minmax(0, 440px);
    justify-content: center;
}

.portal-card {
    display: flex;
    flex-direction: column;
    padding: 26px 24px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #dde4f0;
    box-shadow: 0 6px 20px rgba(3, 34, 105, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    margin-bottom: 0;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(3, 34, 105, 0.1);
    border-color: #b9c8e4;
}

.portal-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.portal-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.portal-card-icon.icon-production {
    background: #eef3ff;
    color: #032269;
}

.portal-card-icon.icon-warehouse {
    background: #fff8df;
    color: #b28400;
}

.portal-card-icon.icon-sales {
    background: #e9f8ef;
    color: #137340;
}

.portal-card-badge {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6b7a90;
    margin-bottom: 2px;
}

.portal-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #032269;
    margin: 0;
}

.portal-card-desc {
    font-size: 13px;
    line-height: 1.55;
    color: #55657d;
    margin: 0 0 18px;
}

.portal-sublinks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 22px;
    flex: 1;
}

.portal-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafd;
    border: 1px solid #e7edf6;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.portal-sublink i {
    color: #032269;
    width: 16px;
    text-align: center;
}

.portal-sublink:hover {
    background: #eef3ff;
    border-color: #c7d6f0;
    color: #032269;
}

.portal-card-footer {
    margin-top: auto;
}

@media (max-width: 980px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
    .brandbar span {
        font-size: 8px;
    }
}
