:root {
    --color-brand:       #1A6FFF;
    --color-brand-dark:  #1255CC;
    --color-accent:      #00D4A1;
    --color-bg:          #F4F6FB;
    --color-surface:     #FFFFFF;
    --color-border:      #E2E8F0;
    --color-text:        #1E2A3B;
    --color-text-muted:  #64748B;
    --color-success:     #00D4A1;
    --color-warning:     #F59E0B;
    --color-danger:      #EF4444;
    --shadow-card:       0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    --shadow-modal:      0 8px 32px rgba(0,0,0,.14);
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  32px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

a {
    color: var(--color-brand);
    text-decoration: none;
}

a:hover {
    color: var(--color-brand-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, select, textarea, button {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(26, 111, 255, 0.12);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-brand-dark);
    color: #fff;
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent:hover {
    background: #00b88e;
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 36px;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-header h2, .card-header h3 {
    font-size: 1.125rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
}

.badge-success {
    background: rgba(0, 212, 161, 0.12);
    color: #00a07a;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b57a08;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.badge-info {
    background: rgba(26, 111, 255, 0.12);
    color: var(--color-brand-dark);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}

.form-group .required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-error {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error.visible {
    display: block;
}

.table-container {
    overflow-x: auto;
}

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

table th, table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

table th {
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

table tr:hover td {
    background: rgba(26, 111, 255, 0.02);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-top: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

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

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
}

.modal-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--color-text);
    color: #fff;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-modal);
    z-index: 2000;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error   { border-left: 4px solid var(--color-danger); }

@media (max-width: 767px) {
    .modal {
        border-radius: var(--radius-md);
        padding: 1rem;
    }
}
