* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: #f4f4f2;
    color: #222;
}

header.topbar {
    background: #2c3e50;
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

header.topbar .brand {
    font-weight: 600;
    font-size: 17px;
}

nav.tabs {
    background: #34495e;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

nav.tabs a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 3px solid transparent;
}

nav.tabs a:hover, nav.tabs a.active {
    background: #3d5871;
    border-bottom: 3px solid #4fa3e0;
}

.userbox {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.userbox form { margin: 0; }

.userbox button {
    background: none;
    border: 1px solid #7f8c9a;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

main {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 20px 40px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
p.hint { color: #666; font-size: 13px; margin: -6px 0 16px; }

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.flash {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash.success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7dfc2; }
.flash.error { background: #fbeaea; color: #a12a2a; border: 1px solid #eebcbc; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #fff;
}
th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}
th { background: #f7f7f5; font-weight: 600; }
td.num, th.num { text-align: center; width: 90px; }
tr.catalog-only td { color: #999; font-style: italic; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f0f6fb; }

label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], select, textarea, input[type=file] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
input[type=checkbox] { width: auto; }

.btn {
    display: inline-block;
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
}
.btn:hover { background: #1f2d3a; }
.btn.secondary { background: #fff; color: #2c3e50; border: 1px solid #ccc; }
.btn.secondary:hover { background: #f2f2f2; }
.btn.danger { background: #a12a2a; }
.btn.danger:hover { background: #841f1f; }
.btn.small { padding: 4px 10px; font-size: 12.5px; margin-top: 0; }

.search-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-end; }
.search-row input { flex: 1; }
.search-row label { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge.pending { background: #fdf2d9; color: #916b0a; }
.badge.approved { background: #e6f4ea; color: #1e7e34; }
.badge.rejected { background: #fbeaea; color: #a12a2a; }

.qty-form { display: flex; gap: 6px; align-items: center; }
.qty-form input { width: 70px; }

.exp-soon { color: #916b0a; font-weight: 600; }
.exp-expired { color: #a12a2a; font-weight: 600; }
.exp-tag { font-size: 10px; }
.exp-tag.soon { color: #916b0a; }
.exp-tag.expired { color: #a12a2a; }

.login-wrap {
    max-width: 340px;
    margin: 80px auto;
}
.login-wrap h1 { text-align: center; }

.home-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.home-links a {
    display: block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    text-decoration: none;
    color: #222;
    font-weight: 600;
    font-size: 14px;
}
.home-links a:hover { border-color: #4fa3e0; }
