:root{
    --bg:#f4f6f8;
    --card:#ffffff;
    --text:#111827;
    --muted:#6b7280;
    --primary:#1d4ed8;
    --primary-dark:#1e40af;
    --danger:#dc2626;
    --ok:#16a34a;
    --warn:#d97706;
    --border:#e5e7eb;
    --shadow:0 10px 30px rgba(0,0,0,.06);
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
}

a{
    text-decoration:none;
    color:var(--primary);
}

.topbar{
    background:#111827;
    color:white;
    padding:16px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
    box-shadow:0 4px 20px rgba(0,0,0,.15);
}

.brand{
    font-size:20px;
    font-weight:800;
    letter-spacing:.3px;
}

.topbar nav{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
}

.topbar a{
    color:white;
    font-weight:700;
    opacity:.95;
}

.topbar a:hover{
    opacity:1;
}

.container{
    max-width:1180px;
    margin:28px auto;
    padding:0 16px;
}

.footer{
    text-align:center;
    color:var(--muted);
    font-size:13px;
    padding:20px;
}

.card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:18px;
    padding:28px;
    box-shadow:var(--shadow);
    margin-bottom:18px;
}

.login-card{
    max-width:430px;
    margin:70px auto;
}

.grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
}

.stat{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:22px;
    box-shadow:0 6px 18px rgba(0,0,0,.035);
}

.stat strong{
    display:block;
    font-size:30px;
    margin-bottom:6px;
}

.stat span{
    color:var(--muted);
}

.actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:center;
    margin:15px 0;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:110px;
    min-height:48px;
    border:0;
    border-radius:14px;
    padding:12px 18px;
    background:var(--primary);
    color:#fff;
    font-weight:800;
    cursor:pointer;
    text-align:center;
    line-height:1.2;
    box-shadow:0 8px 18px rgba(29,78,216,.22);
    transition:all .2s ease;
}

.btn:hover{
    background:var(--primary-dark);
    transform:translateY(-1px);
    box-shadow:0 10px 22px rgba(29,78,216,.28);
}

.btn.secondary{
    background:#374151;
    box-shadow:0 8px 18px rgba(55,65,81,.22);
}

.btn.secondary:hover{
    background:#1f2937;
}

.btn.danger{
    background:var(--danger);
}

.btn.light{
    background:#e5e7eb;
    color:#111827;
    box-shadow:none;
}

form .row{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}

label{
    display:block;
    font-weight:800;
    margin:10px 0 6px;
}

input,
select,
textarea{
    width:100%;
    border:1px solid #d1d5db;
    border-radius:12px;
    padding:12px;
    font-size:15px;
    background:#fff;
    outline:none;
}

input:focus,
select:focus,
textarea:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(29,78,216,.12);
}

textarea{
    min-height:100px;
    resize:vertical;
}

table{
    width:100%;
    border-collapse:collapse;
    background:white;
    border-radius:14px;
    overflow:hidden;
}

th,
td{
    padding:14px;
    border-bottom:1px solid var(--border);
    text-align:left;
    vertical-align:top;
}

th{
    background:#f9fafb;
    font-weight:800;
}

.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    background:#e5e7eb;
}

.badge.ok{
    background:#dcfce7;
    color:#166534;
}

.badge.warn{
    background:#fef3c7;
    color:#92400e;
}

.badge.danger{
    background:#fee2e2;
    color:#991b1b;
}

.badge.info{
    background:#dbeafe;
    color:#1e40af;
}

.message{
    padding:12px;
    border-radius:12px;
    margin-bottom:14px;
    background:#ecfdf5;
    color:#065f46;
}

.error{
    padding:12px;
    border-radius:12px;
    margin-bottom:14px;
    background:#fef2f2;
    color:#991b1b;
}

.search{
    display:flex;
    gap:10px;
    margin-bottom:15px;
}

.search input{
    max-width:420px;
}

.small{
    color:var(--muted);
    font-size:13px;
}

.project-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    flex-wrap:wrap;
}

.print-only{
    display:none;
}

@media(max-width:800px){
    .grid,
    form .row{
        grid-template-columns:1fr;
    }

    .topbar{
        align-items:flex-start;
    }

    .search{
        flex-direction:column;
    }

    table{
        font-size:14px;
    }

    th:nth-child(3),
    td:nth-child(3){
        display:none;
    }

    .btn{
        width:100%;
    }
}

@media print{
    .topbar,
    .footer,
    .actions,
    .btn{
        display:none;
    }

    .container{
        max-width:100%;
        margin:0;
    }

    .card{
        box-shadow:none;
        border:0;
    }

    .print-only{
        display:block;
    }
}