:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #0b0f19;
    --card-bg: rgba(20, 26, 35, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(11, 15, 25, 0.6);
    --th-bg: rgba(20, 26, 35, 0.9);
    --badge-bg: rgba(51, 65, 85, 0.8);
    --glass-blur: blur(20px);
}

body.light-theme {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #f1f5f9;
    --th-bg: #f8fafc;
    --badge-bg: #e2e8f0;
    --glass-blur: blur(0px);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

/* Base styles for inner containers inside main content */
.container {
    width: 100%;
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

h1,
h2,
h3,
h4 {
    color: var(--text);
    margin-top: 0;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="color"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

select option {
    background: var(--bg);
    color: var(--text);
}

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

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: var(--card-bg);
}

/* SLEEK & SHINY BUTTONS */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 12px 20px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}

.btn:hover::after {
    left: 150%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn i {
    font-size: 1.1em;
}

.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

body.light-theme .alert.success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

body.light-theme .alert.error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-action {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.input-action input {
    flex: 1;
}

.input-action .btn {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Modern Document Table Styling */
.doc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    background: var(--input-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    table-layout: fixed;
}

.doc-table th,
.doc-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table th {
    background: var(--th-bg);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.doc-table tbody tr {
    transition: background 0.2s;
}

.doc-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.light-theme .doc-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--badge-bg);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.doc-table th:nth-child(1) {
    width: 30%;
}

.doc-table th:nth-child(2) {
    width: 45%;
}

.doc-table th:nth-child(3) {
    width: 10%;
}

.doc-table th:nth-child(4) {
    width: 15%;
}

.truncate-text {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: help;
}

.truncate-text:hover {
    white-space: normal;
    word-break: break-all;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 100;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
}