/* =====================================================
   UAB TERONIS - Tiekimų Valdymo Sistema - Stiliai
   ===================================================== */

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

/* === Variables === */
:root {
    --primary: #087a56;
    --primary-dark: #065e42;
    --primary-light: #d1fae5;
    --primary-lighter: #ecfdf5;
    --secondary: #64748b;
    --success: #059669;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    --info-bg: #e0f2fe;
    --purple: #7c3aed;
    --purple-bg: #ede9fe;
    --bg: #f8faf9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --transition: all 0.15s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* === Navbar === */
.navbar {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(8, 122, 86, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.nav-brand:hover { color: white; opacity: 0.9; }

.nav-logo { height: 32px; width: auto; }

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover { color: white; background: rgba(255,255,255,0.15); }
.nav-link.active { color: white; background: rgba(255,255,255,0.2); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.nav-employee {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-lighter);
}

.card-header h2 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* === Stats Row === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Tables === */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--primary-lighter);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

table tr:hover { background: var(--primary-lighter); }
table tr:last-child td { border-bottom: none; }

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

.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); color: white; }

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

/* === Forms === */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 122, 86, 0.15);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: var(--success-bg); color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: var(--danger-bg); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-bg); color: #075985; border-left: 4px solid var(--info); }

/* === Order Detail Grid === */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.detail-item {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child, .detail-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.detail-item.full-width { grid-column: 1 / -1; }

.detail-label {
    width: 140px;
    padding: 10px 14px;
    background: var(--primary-lighter);
    font-weight: 500;
    font-size: 13px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.detail-value {
    padding: 10px 14px;
    font-size: 14px;
    flex: 1;
}

/* === Best Price Highlight === */
.best-price { background: #ecfdf5; }
.best-price td { font-weight: 600; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #065e42 0%, #087a56 50%, #0ea572 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo-img { max-height: 60px; margin-bottom: 16px; }

.login-box h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}

/* === Supplier Response Page === */
.response-container {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 20px;
}

.response-header {
    text-align: center;
    margin-bottom: 24px;
}

.response-header img { max-height: 50px; margin-bottom: 12px; }

/* === Filter Bar === */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    width: auto;
    min-width: 180px;
}

/* === Utilities === */
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
}

/* === Action Buttons in Tables === */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns a {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
}

.action-btns a:hover { opacity: 0.8; }

/* === Responsive === */
@media (max-width: 768px) {
    .nav-container { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .nav-links { order: 3; width: 100%; overflow-x: auto; }
    .container { padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-label { border-right: none; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .login-box { padding: 32px 24px; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100%; }
}
