/* ---------------- Body & Layout ---------------- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f3f7;
    color: #2c3e50;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------------- Header ---------------- */
header {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

header .logo {
    font-size: 22px;
    font-weight: bold;
    color: #3498db;
}

header nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

header nav a {
    padding: 8px 18px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background: #fff;
    color: #3498db;
    font-weight: 500;
    transition: all 0.2s ease;
    border-width: 0 1px 0 1px;
}

header nav a:hover,
header nav a.active {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

/* ---------------- Cards ---------------- */
.card {
    background: #fff;
    margin: 20px;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

/* ---------------- Typography ---------------- */
h1, h2, h3 {
    margin: 0 0 15px 0;
}

h1 {
    font-size: 28px;
    color: #2c3e50;
}

/* ---------------- Inputs & Buttons ---------------- */
input, select {
    width: 100%;
    padding: 12px 14px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    border-color: #3498db;
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.3);
    outline: none;
}

button {
    padding: 10px 18px;
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    background: #3498db;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: #2980b9;
}

button.cancel {
    background: #e74c3c;
}

button.copy-btn {
    padding: 5px 10px;
    font-size: 12px;
    margin-left: 5px;
    background: #95a5a6;
    color: #fff;
}

/* ---------------- Tabs ---------------- */
.tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.tabs .tabBtn {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background: #fff;
    color: #3498db;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tabs .tabBtn.active {
    background: #3498db;
    color: #fff;
}

/* ---------------- Table ---------------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

th {
    background: #ecf0f1;
}

tr:nth-child(even) {
    background: #fafafa;
}

tr:hover {
    background: #d6eaf8;
}

.status-pending {
    color: #e67e22;
    font-weight: bold;
}

.status-completed {
    color: #2ecc71;
    font-weight: bold;
}

.pwd {
    font-family: monospace;
    letter-spacing: 2px;
}

/* ---------------- Pagination ---------------- */
button.page-btn {
    padding: 6px 12px;
    margin: 3px;
    border-radius: 8px;
    background: #ecf0f1;
    color: #2c3e50;
    font-weight: bold;
    cursor: pointer;
}

button.page-btn.active {
    background: #3498db;
    color: #fff;
}

/* ---------------- Modal ---------------- */
.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal {
    background: #fff;
    padding: 30px 35px;
    border-radius: 16px;
    width: 480px;
    max-width: 95%;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {transform: translateY(-50px); opacity:0;}
    to {transform: translateY(0); opacity:1;}
}

.modal h3 {
    margin-top: 0;
}

.modal .close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #333;
}

.group {
    border: 2px solid #3498db;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f0f8ff;
}

.group.similar {
    border-color: #e67e22;
    background-color: #fff3e0;
}

.group-header {
    font-weight: bold;
    margin-bottom: 8px;
}

#totals {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    overflow-x: auto; /* enable horizontal scroll if too many */
    padding-bottom: 5px;
}

.total-card {
    flex: 0 0 auto; /* prevent shrinking */
    min-width: 120px;
    background: #f4f4f4;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.total-card:hover {
    transform: translateY(-3px);
}

.total-card h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #555;
}

.total-card span {
    font-size: 22px;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.total-card.pending { background-color: #fff4e5; color: #e67e22; }
.total-card.completed { background-color: #e8f8f5; color: #16a085; }
.total-card.all { background-color: #ebf0f7; color: #2980b9; }
.total-card.type { background-color: #f9e8f9; color: #8e44ad; font-size: 12px; }

/* ---------------- Responsive ---------------- */
@media screen and (max-width: 700px) {
    header {flex-direction: column; align-items: flex-start;}
    header nav {flex-direction: column; gap: 5px; margin-top: 10px;}
    .modal {width: 95%;}
}
