/* ================================================
   PLASTIKSĖ — Žaliavų apskaitos sistema
   Global stylesheet
   ================================================ */

html, body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    color: #1a1a1a;
}

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

/* ================================================
   LOGIN / SELECTION PAGES
   ================================================ */

.page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    background: #fff;
}

.login-box {
    width: 100%;
    max-width: 640px;
    padding: 32px;
    text-align: center;
}

.brand-title {
    font-family: 'Cambria', 'Georgia', serif;
    font-size: 64pt;
    color: #0A3791;
    margin: 0 0 8px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 36px;
    font-weight: 400;
    margin: 0 0 40px;
}

/* Role selection buttons */
.login-role-label {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 28px;
}

.btn-role {
    display: block;
    width: 320px;
    margin: 0 auto 20px;
    padding: 17px 24px;
    background: #0A3791;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    text-align: center;
    transition: background 0.15s;
}

.btn-role:hover {
    background: #082c6b;
    color: #fff;
}

/* Login form */
.login-heading {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 28px;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 12px;
    text-align: left;
}

.code-msgbox {
    margin-bottom: 12px;
    text-align: left;
}

.code-msg {
    width: 100%;
    padding: 13px 16px;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 12px;
    font-family: Lucida Console, Consolas, monaco, monospace;
    color: #1a1a1a;
    transition: border-color 0.15s, background 0.15s;
}

.radio-group {
    width: 100%;
    margin-bottom: 12px;
    font-size: 16px;
    font-family: inherit;
    text-align: left;
    column-count: 2;
    column-gap: 12px;
    column-rule: hidden;
}

.form-radio {
    width: 100%;
    padding: 13px 16px;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a1a;
    transition: border-color 0.15s, background 0.15s;
    display: inline-block;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a1a;
    transition: border-color 0.15s, background 0.15s;
}

.form-input::placeholder {
    color: #999;
}

.form-input:focus {
    outline: none;
    border-color: #0A3791;
    background: #edf1fb;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    background: #0A3791;
    color: #fff;
    font-size: 17px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #082c6b;
}

.error-msg {
    color: #cc0000;
    font-size: 14px;
    margin-bottom: 14px;
    text-align: center;
    padding: 10px;
    background: #fdecea;
    border-radius: 6px;
    border: 1px solid #f5c6c6;
}

/* ================================================
   APP LAYOUT
   ================================================ */

.app-body {
    background: #f0f0f0;
    min-height: 100vh;
}

/* ----- Navbar ----- */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.hamburger {
    font-size: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    color: #1a1a1a;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s;
}

.hamburger:hover {
    background: #f0f0f0;
}

.navbar-title {
    font-size: 20px;
    font-weight: 500;
    color: #1a1a1a;
}

.navbar-right {
    font-size: 13px;
    color: #666;
    text-align: right;
    line-height: 1.5;
}

/* Hamburger dropdown menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 200;
    padding: 6px 0;
}

.nav-dropdown.open {
    display: block;
}

.nav-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.1s;
}

.nav-dropdown a:hover {
    background: #f5f5f5;
    color: #0A3791;
}

.nav-dropdown .nav-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 0;
}

/* ----- Main content ----- */
.main-content {
    padding: 48px 56px;
}

/* ----- Dashboard cards ----- */
.dashboard-cards {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.dashboard-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 48px 32px;
    min-width: 220px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.dashboard-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
    transform: translateY(-3px);
}

.dashboard-card span {
    font-size: 22px;
    color: #0A3791;
    font-weight: 400;
    text-align: center;
}

/* ----- Content panels ----- */
.content-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-title {
    font-size: 22px;
    font-weight: 600;
    color: #0A3791;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ----- Tables ----- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.data-table td {
    border: 1px solid #e8e8e8;
    padding: 10px 14px;
    color: #1a1a1a;
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: #f8f9ff;
}

/* ----- Buttons ----- */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.4;
}

.btn-blue {
    background: #0A3791;
    color: #fff;
}
.btn-blue:hover { background: #082c6b; color: #fff; }

.btn-outline {
    background: #fff;
    color: #0A3791;
    border: 1px solid #0A3791;
}
.btn-outline:hover { background: #edf1fb; }

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}
.btn-danger:hover { background: #9b1b1b; color: #fff; }

/* ----- Form elements ----- */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-col {
    display: flex;
    flex-direction: column;
}

.app-input, .app-select, .app-textarea {
    width: 100%;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px solid #d8d8d8;
    border-radius: 7px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    transition: border-color 0.15s, background 0.15s;
}

.app-input:focus, .app-select:focus, .app-textarea:focus {
    outline: none;
    border-color: #0A3791;
    background: #edf1fb;
}

.app-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ----- Modal ----- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 400;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #0A3791;
    margin: 0 0 22px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ebebeb;
}

/* ----- Alerts ----- */
.alert {
    padding: 11px 16px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffe082;
}

/* ----- Status badges ----- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green  { background: #e8f5e9; color: #2e7d32; }
.badge-yellow { background: #fff8e1; color: #e65100; }
.badge-red    { background: #fdecea; color: #c62828; }
.badge-blue   { background: #e3f2fd; color: #0A3791; }
.badge-gray   { background: #f5f5f5; color: #555; }

/* ----- Low-stock row highlight ----- */
.row-low td {
    background: #fff8e1;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .main-content { padding: 24px 16px; }
    .dashboard-cards { flex-direction: column; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
