/* ===== Global Reset ===== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #cfe9f7, #9fd3f2);
    color: blue;
}

/* ===== Page Container ===== */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ===== Headings ===== */
h1, h2, h3 {
    margin-top: 0;
    color: blue;
}

/* ===== Card / Box ===== */
.box {
    background: #1e293b;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

/* ===== Forms ===== */
input, select, button {
    width: 100%;
    padding: 12px 14px;
    margin-top: 12px;
    border-radius: 6px;
    border: 1px solid #334155;
    font-size: 14px;
}

input, select {
    background: #0f172a;
    color: #e5e7eb;
}

input::placeholder {
    color: #94a3b8;
}

input:focus, select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.25);
}

/* ===== Buttons ===== */
button {
    background: #38bdf8;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

button:hover {
    background: #0ea5e9;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(255,255,255,0.4);
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    text-align: left;
}

th {
    background: rgba(255,255,255,0.6);
    font-weight: 600;
}

/* ===== Status Colors ===== */
.ok {
    color: #16a34a;
    font-weight: bold;
}

.low {
    color: #ca8a04;
    font-weight: bold;
}

.zero {
    color: #dc2626;
    font-weight: bold;
}

/* ===== Links ===== */
a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

/* ===== Messages ===== */
.error {
    background: rgba(220,38,38,0.15);
    border: 1px solid #dc2626;
    padding: 10px;
    border-radius: 6px;
    color: #7f1d1d;
}

.success {
    background: rgba(22,163,74,0.15);
    border: 1px solid #16a34a;
    padding: 10px;
    border-radius: 6px;
    color: #14532d;
}

.login-page {
    background: linear-gradient(135deg, #cfe9f7, #9fd3f2);
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #1e293b;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #e5e7eb;
    font-weight: 600;
}

/* Form labels */
.login-box label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #cbd5f5;
}

/* Inputs */
.login-box input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 15px;
}

.login-box input::placeholder {
    color: #94a3b8;
}

.login-box input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.3);
}

/* Button */
.login-box button {
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #38bdf8;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.login-box button:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

.login-box button:active {
    transform: translateY(0);
}

/* Error message */
.login-box .error {
    background: rgba(248,113,113,0.15);
    border: 1px solid #f87171;
    padding: 10px;
    border-radius: 8px;
    color: #fecaca;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin-bottom: 6px;
}

.subtitle {
    color: #334155;
    font-size: 15px;
}

/* Grid layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Cards */
.dashboard-card {
    background: #1e293b;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #e5e7eb;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #38bdf8;
    font-size: 18px;
}

.dashboard-card p {
    margin: 0;
    font-size: 14px;
    color: #cbd5f5;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* Footer */
.dashboard-footer {
    margin-top: 40px;
    text-align: right;
}

.logout {
    color: #dc2626;
    font-weight: 600;
}

.logout:hover {
    text-decoration: underline;
}

.page-header {
    margin-bottom: 20px;
}

.page-header a {
    font-size: 14px;
}

/* Two-column layout */
.two-column {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: start;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.45);
    border-radius: 10px;
    overflow: hidden;
}

th {
    background: rgba(255,255,255,0.65);
    font-weight: 600;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    text-align: left;
}

/* Low stock row */
.row-low {
    background: rgba(220,38,38,0.15);
}

/* Messages */
.success {
    background: rgba(22,163,74,0.15);
    border: 1px solid #16a34a;
    padding: 12px;
    border-radius: 8px;
    color: #14532d;
    margin-bottom: 20px;
}

/* Inactive rows */
.row-inactive {
    color: #64748b;
    background: rgba(100,116,139,0.1);
}

/* Action links */
.action-link {
    font-weight: 600;
    color: #2563eb;
}

.action-link:hover {
    text-decoration: underline;
}

.action-link {
    font-weight: 600;
    color: #2563eb;
}

.action-link:hover {
    text-decoration: underline;
}

.action-link.danger {
    color: #dc2626;
}

.success {
    background: rgba(22,163,74,0.15);
    border: 1px solid #16a34a;
    padding: 12px;
    border-radius: 8px;
    color: #14532d;
    margin-bottom: 20px;
}

.status-ok {
    color: #16a34a;
    font-weight: 600;
}

.status-low {
    color: #ca8a04;
    font-weight: 600;
}

.status-out {
    color: #dc2626;
    font-weight: 600;
}

.status-out small {
    display: block;
    font-size: 12px;
    color: #7f1d1d;
    margin-top: 4px;
}

/* Row highlighting */
.row-low {
    background: rgba(234,179,8,0.12);
}

.row-out {
    background: rgba(220,38,38,0.12);
}

.available-count {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.status-cell {
    min-width: 200px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Available */
.status-badge.ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #22c55e;
}

/* Low */
.status-badge.low {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #facc15;
}

/* Out */
.status-badge.out {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #dc2626;
}

/* Blockers */
.blockers {
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
    max-width: 260px;
}

.btn-add-item {
    width: 15%;
    min-width: 160px;
    display: block;
    margin-top: 10px;
}
