/* TSM faktūrų importas — dizainas pagal produktai.tdline.lt (Teronis) */
:root {
    --teronis-dark:   #0a4a3a;
    --teronis-mid:    #0d6044;
    --teronis-bright: #0f7a55;
    --teronis-accent: #10b981;
    --bg:             #f3f5f7;
    --card:           #ffffff;
    --border:         #e5e7eb;
    --text:           #111827;
    --text-muted:     #6b7280;
    --text-light:     #9ca3af;
    --bg-input:       #f9fafb;
    --success:        #059669;
    --success-bg:     #d1fae5;
    --warning:        #d97706;
    --warning-bg:     #fef3c7;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --info:           #2563eb;
    --info-bg:        #dbeafe;
}
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--teronis-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === HEADER === */
header {
    background: var(--teronis-mid);
    color: #fff;
    padding: 0 32px;
    display: flex;
    align-items: center;
    height: 64px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
header .brand { display: flex; align-items: center; gap: 14px; margin-right: 40px; font-weight: 500; }
header .brand img { height: 28px; width: auto; }
header .brand .sub { font-size: 13px; opacity: 0.85; border-left: 1px solid rgba(255,255,255,0.3); padding-left: 14px; }
header nav { display: flex; gap: 4px; flex: 1; }
header nav a { padding: 8px 18px; color: rgba(255,255,255,0.85); border-radius: 8px; font-weight: 500; font-size: 14px; transition: all 0.15s; }
header nav a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
header nav a.active { color: var(--teronis-mid); background: #fff; }
header .user-area { display: flex; align-items: center; gap: 16px; }
header .user-info { font-size: 13px; color: rgba(255,255,255,0.9); }
header .user-info .role { opacity: 0.7; margin-left: 4px; }
header .logout-btn {
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4);
    padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: inherit; text-decoration: none; transition: all 0.15s;
}
header .logout-btn:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }

/* === MAIN === */
main { max-width: 1240px; margin: 32px auto; padding: 0 32px; }
h1 { margin: 0 0 24px 0; font-size: 28px; font-weight: 700; }
h2 { margin: 32px 0 16px 0; font-size: 18px; font-weight: 600; }
h3 { margin: 20px 0 10px 0; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.page-head { display: flex; align-items: center; justify-content: space-between; }
.muted, .text-muted { color: var(--text-muted); }

/* === CARDS === */
.card { background: var(--card); border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* === TABLES === */
table, .table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; background: #fafbfc; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

/* === BUTTONS === */
.btn {
    display: inline-block; padding: 9px 18px; background: var(--teronis-mid); color: #fff;
    border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 500;
    font-family: inherit; text-decoration: none; transition: background-color 0.15s;
}
.btn:hover { background: var(--teronis-dark); text-decoration: none; color: #fff; }
.btn:active { background: #083828; }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; color: var(--text); }
.btn-small { padding: 5px 12px; font-size: 12px; }
.link { background: none; border: 0; color: var(--teronis-mid); cursor: pointer; padding: 0; font: inherit; }
.inline { display: inline; }

/* === BADGES === */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; background: #f3f4f6; color: var(--text-muted); }
.badge-processing, .badge-review { background: var(--warning-bg); color: var(--warning); }
.badge-done { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--danger-bg); color: var(--danger); }

/* === FLASH / ALERT === */
.flash, .alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.flash-error, .alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

/* === LOGIN (body.auth) === */
body.auth {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--teronis-dark) 0%, var(--teronis-mid) 60%, var(--teronis-bright) 100%);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.25), 0 10px 20px -5px rgba(0,0,0,0.1);
    padding: 48px 40px; width: 100%; max-width: 420px;
}
.login-card .logo { display: flex; justify-content: center; margin-bottom: 12px; }
.login-card .logo img { height: 42px; width: auto; }
.login-card h1 { font-size: 24px; font-weight: 700; text-align: center; margin: 24px 0 4px 0; }
.login-card .subtitle { font-size: 13px; color: var(--teronis-mid); text-align: center; margin-bottom: 32px; font-weight: 500; }

/* === FORMS === */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password],
.form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); background: var(--bg-input);
    border-radius: 10px; font-size: 14px; font-family: inherit;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--teronis-mid); background: #fff;
    box-shadow: 0 0 0 3px rgba(13,96,68,0.1);
}
.submit-btn {
    width: 100%; padding: 14px 16px; background: var(--teronis-mid); color: #fff;
    border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: background-color 0.15s; margin-top: 8px;
}
.submit-btn:hover { background: var(--teronis-dark); }
.submit-btn:active { background: #083828; }

/* === FOOTER === */
.footer { text-align: center; color: var(--text-light); font-size: 12px; padding: 24px; }

/* === RESPONSIVE === */
@media (max-width: 720px) {
    header { padding: 0 16px; height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
    header .brand { margin-right: 0; }
    header .brand .sub { display: none; }
    header nav { width: 100%; overflow-x: auto; }
    main { padding: 0 16px; margin-top: 20px; }
}
