/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #0984e3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* === Navbar === */
.navbar {
    background: #fff;
    border-bottom: 1px solid #dfe6e9;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3436;
    margin-right: 2rem;
}

.navbar-brand a:hover {
    text-decoration: none;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.navbar-menu li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #636e72;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.navbar-menu li a:hover {
    background: #f0f0f0;
    color: #2d3436;
    text-decoration: none;
}

.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user {
    font-size: 0.85rem;
    color: #636e72;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary {
    background: #0984e3;
    color: #fff;
}

.btn-primary:hover {
    background: #0773c5;
}

.btn-danger {
    background: #d63031;
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-outline {
    background: transparent;
    border: 1px solid #b2bec3;
    color: #636e72;
}

.btn-outline:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    color: #636e72;
    font-size: 1rem;
    transition: background 0.15s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.btn-icon.danger:hover {
    background: #ffeaea;
    color: #d63031;
}

/* === Cards (Dashboard) === */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 3rem auto;
}

.card {
    background: #fff;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3436;
}

/* === Tables === */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.table-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 0.45rem 0.75rem;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 250px;
    outline: none;
    transition: border-color 0.15s;
}

.search-box input:focus {
    border-color: #0984e3;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

thead th {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #dfe6e9;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

thead th:hover {
    background: #eef1f3;
}

thead th .sort-indicator {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    color: #b2bec3;
}

thead th .sort-indicator.active {
    color: #0984e3;
}

tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f2f6;
    font-size: 0.875rem;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 0.25rem;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #e6f9ee;
    color: #00b894;
}

.badge-error {
    background: #ffeaea;
    color: #d63031;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.4rem 0.75rem;
    border: 1px solid #dfe6e9;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination .page-info {
    font-size: 0.85rem;
    color: #636e72;
}

/* === Modals === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #636e72;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #0984e3;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* === Login === */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.login-box .subtitle {
    text-align: center;
    color: #636e72;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-box .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
    margin-top: 0.5rem;
}

/* === Alerts === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #ffeaea;
    color: #d63031;
    border: 1px solid #ffcccc;
}

.alert-success {
    background: #e6f9ee;
    color: #00b894;
    border: 1px solid #b8f0d1;
}

/* === Fieldsets === */
.form-fieldset {
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    padding: 1rem 1rem 0.25rem;
    margin-bottom: 1rem;
}

.form-fieldset legend {
    font-size: 0.8rem;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0.4rem;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #b2bec3;
}

.empty-state p {
    font-size: 0.95rem;
}
