/* ===================================
GLOBAL RESET & BASE
=================================== */

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f2f3f4;
    color: #222;
    display: flex;
    flex-direction: column;
}

.page-container {
    flex: 1;
}

/* ===================================
HEADER
=================================== */

header{
    background:#0f172a;
    position:sticky;
    top:0;
    z-index:1000;
    box-shadow:0 2px 10px rgba(0,0,0,.15);
}

.nav-wrapper{
    max-width:1400px;
    margin:0 auto;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 25px;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
}

.logo-box{
    width:42px;
    height:42px;
    background:#2563eb;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
}

.brand a{
    color:#fff;
    text-decoration:none;
    font-size:24px;
    font-weight:700;
}

/* ===================================
NAVIGATION
=================================== */

.nav-menu ul{
    list-style:none;
    display:flex;
    align-items:center;
    gap:1.2rem;
}

.nav-menu a,
.nav-menu span{
    color:white;
    text-decoration:none;
    cursor:pointer;
    padding:12px 16px;
    border-radius:6px;
}

.nav-menu a:hover,
.nav-menu span:hover{
    background:#2563eb;
}

/* ===================================
DROPDOWNS
=================================== */

.dropdown{
    position:relative;
}

.dropdown-menu{
    display:none !important;
    position:absolute;
    top:100%;
    left:0;
    background:#0f172a;
    min-width:220px;
    border:1px solid rgba(255,255,255,0.2);
    z-index:1000;
}

.dropdown-menu a{
    display:block;
    padding:0.65rem 1rem;
    white-space:nowrap;
}

/* Desktop dropdown behaviour */
@media (min-width:801px){
    .dropdown:hover > .dropdown-menu,
    .dropdown:focus-within > .dropdown-menu{
        display:block !important;
    }

    .dropdown-menu:hover{
        display:block !important;
    }

    .dropdown-menu a:hover{
        background:#2563eb;
    }
}

/* Mobile nav */
#nav-toggle{
    display:none;
}

.nav-toggle-label{
    display:none;
}

@media (max-width:800px){

    .nav-toggle-label{
        display:block;
        color:white;
        font-size:28px;
        cursor:pointer;
    }

    .nav-wrapper{
        flex-wrap:wrap;
    }

    .nav-menu{
        display:none;
        width:100%;
        background:#0f172a;
    }

    #nav-toggle:checked + .nav-toggle-label + .nav-menu{
        display:block;
    }

    .nav-menu ul{
        flex-direction:column;
        align-items:flex-start;
        padding:1rem;
        gap:0.75rem;
    }

    .dropdown-menu{
        position:static;
        border:none;
        display:none !important;
    }

    .dropdown:focus-within > .dropdown-menu{
        display:block !important;
    }

    .dropdown-menu a{
        padding-left:35px;
    }
}

/* ===================================
DASHBOARD
=================================== */

.dash-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.dash-welcome {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #555;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    padding: 20px 0 40px;
}

.card {
    background: white;
    padding: 32px 26px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 110px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 18px rgba(0,0,0,.12);
}

.card-icon {
    font-size: 1.9rem;
}

/* ===================================
FOOTER
=================================== */

.site-footer {
    background: #0f172a;
    color: #d1d5db;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    opacity: 0.85;
}

.site-footer:hover {
    opacity: 1;
}

/* ===================================
AUTH PAGES (LOGIN + SIGNUP)
=================================== */

.auth-page body {
    background: #0f172a !important;
    justify-content: center;
    align-items: center;
}

.auth-page .login-container {
    background: #ffffff;
    color: #333;
    width: 100%;
    max-width: 480px;
    padding: 40px 45px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-align: center;
}

.auth-page .logo h1 {
    font-size: 1.7rem;
    margin-bottom: 5px;
    color: #0f172a;
}

.auth-page .logo p {
    margin-bottom: 25px;
    color: #555;
    font-size: 1rem;
}

.auth-page form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #0f172a;
}

.auth-page form input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.auth-page form input:focus {
    border-color: #2563eb;
    outline: none;
}

.auth-page form button {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.auth-page form button:hover {
    background: #1d4ed8;
}

.auth-page .error {
    background: #ffdddd;
    color: #b00020;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e5a5a5;
}

.auth-page .success {
    background: #e6ffed;
    color: #0f5132;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #b7e4c7;
}

.auth-page a {
    display: inline-block;
    margin-top: 15px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.auth-page a:hover {
    text-decoration: underline;
}

/* Low Stock Report Table */
.report-table-container {
    margin-top: 25px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

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

.report-table th {
    background: #0f172a;
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 0.95rem;
}

.report-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.report-table tr:hover td {
    background: #f9fafb;
}

.low-stock-badge {
    background: #dc2626;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===================================
CARDS
=================================== */

.card{
    background:#fff;
    padding:25px;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
    margin-bottom:20px;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
}

.dashboard-grid .card{
    text-align:center;
}

.dashboard-grid .card h3{
    color:#2563eb;
    margin-bottom:10px;
}

.dashboard-grid .card p{
    font-size:32px;
    font-weight:bold;
}

.btn{
    display:inline-block;
    background:#2563eb;
    color:#fff !important;
    text-decoration:none;
    padding:12px 20px;
    border-radius:6px;
    margin-right:10px;
    transition:.2s;
}

.btn:hover{
    background:#1d4ed8;
}

/* Search */

.search-form{
    display:flex;
    align-items:center;
    gap:8px;

    background:none;
    box-shadow:none;
    padding:0;
    margin:0;
}

.search-form input{
    width:220px;
    margin:0;
}

.search-form button{
    padding:10px 14px;
}

/* ===================================
STATUS BOXES
=================================== */

.success-box {
    background: #dcfce7;
    color: #166534;
    border-left: 5px solid #22c55e;
    padding: 18px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    border-left: 5px solid #ef4444;
    padding: 18px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
}

/* ===============================
   STOCK HISTORY
================================ */

.stock-in{
    color:#15803d;
    font-weight:600;
}

.stock-out{
    color:#dc2626;
    font-weight:600;
}

.stock-adjustment{
    color:#d97706;
    font-weight:600;
}

.alert{
    background:#dbeafe;
    color:#1e3a8a;
    padding:15px;
    border-radius:8px;
    margin-bottom:20px;
}

.status {
    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    font-size:13px;
    font-weight:bold;
}

.status-green{
    background:#dcfce7;
    color:#166534;
}

.status-orange{
    background:#fed7aa;
    color:#9a3412;
}

.status-red{
    background:#fecaca;
    color:#991b1b;
}

/* ===================================
KIT VIEW
=================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.stat-card h3 {
    color: #64748b;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 40px;
    font-weight: bold;
    color: #0f172a;
    line-height: 1;
}

.stat-text {
    margin-top: 12px;
    color: #475569;
}

.status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    margin-top: 15px;
}

.status-green {
    background: #dcfce7;
    color: #166534;
}

.status-orange {
    background: #fef3c7;
    color: #92400e;
}

.status-red {
    background: #fee2e2;
    color: #991b1b;
}

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

.form-grid label{
    display:block;
    font-weight:bold;
    margin-bottom:6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea{
    width:100%;
    padding:10px;
    box-sizing:border-box;
}

.success{
    background:#dff6dd;
    color:#205522;
    border:1px solid #8cc68c;
    padding:12px;
    margin-bottom:20px;
    border-radius:6px;
}

.error{
    background:#ffe5e5;
    color:#8b0000;
    border:1px solid #d77;
    padding:12px;
    margin-bottom:20px;
    border-radius:6px;
}