:root {
    --primary-color: #d32f2f;
    --primary-hover: #b71c1c;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --success-color: #2e7d32;
    --warning-color: #f57f17;
    --danger-color: #c62828;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --navbar-height: 60px;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.navbar {
    background-color: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: var(--navbar-height);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand img {
    max-height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
    list-style: none;
    height: 100%;
}

.nav-item-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover, 
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(211, 47, 47, 0.04);
}

.nav-link.active {
    border-bottom-color: var(--primary-color);
}

.nav-link.logout {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.content-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

h1,
h2,
h3,
h4 {
    margin-bottom: 1rem;
    color: #222;
}

.btn-primary, 
.btn-danger, 
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    color: white;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.2;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
}

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

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

.btn-secondary {
    background-color: #757575;
}

.btn-secondary:hover {
    background-color: #616161;
    color: white;
}

.btn-primary:active,
.btn-danger:active,
.btn-secondary:active {
    transform: translateY(1px);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.system-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in;
    text-align: left;
    width: 100%;
}

.system-alert.error {
    background-color: #ffebee;
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.system-alert.success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border-color: var(--success-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-muted);
}

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

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-link {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeEffect 0.3s;
}

@keyframes fadeEffect {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    min-width: 200px;
    border: 1px solid var(--border-color);
    border-top: none;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 1001;
    border-radius: 0 0 6px 6px;
}

.nav-item-wrapper:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .nav-item-wrapper {
    height: auto;
    display: block;
}

.dropdown-menu .nav-link {
    padding: 10px 20px;
    height: auto;
    width: 100%;
    border-bottom: none;
}

.dropdown-menu .nav-link:hover {
    background-color: #f5f5f5;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 1rem;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--primary-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    margin-bottom: 1.5rem;
}

.login-header p {
    color: var(--text-muted);
}

.dd {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 20px;
}

.dd-list {
    display: block;
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dd-list .dd-list {
    padding-left: 30px;
}

.dd-item,
.dd-empty {
    display: block;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 20px;
}

.dd-handle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: grab;
    transition: background 0.2s;
}

.dd-handle:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.dd-handle:active {
    cursor: grabbing;
}

.dd-handle .actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dd-handle .actions form {
    margin: 0;
    padding: 0;
    display: inline-flex;
}

.dd-placeholder {
    display: block;
    position: relative;
    margin: 5px 0;
    padding: 0;
    min-height: 40px;
    background: #f0f4c3;
    border: 1px dashed #cddc39;
    border-radius: 4px;
}

.responsive-split-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.responsive-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.captcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        border-top: 1px solid var(--border-color);
        padding-bottom: 2rem;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-item-wrapper {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-link {
        width: 100%;
        padding: 15px 20px;
        height: auto;
        justify-content: space-between;
        border-bottom: 1px solid #eee;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        width: 100%;
        display: none;
        background-color: #fafafa;
        padding-left: 0;
    }

    .nav-item-wrapper.expanded > .dropdown-menu {
        display: block;
    }

    .dropdown-menu .nav-link {
        padding-left: 40px;
    }

    .responsive-split-1-2,
    .responsive-grid-3 {
        grid-template-columns: 1fr;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #fff;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
        padding: 10px 15px;
    }

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

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: 10px;
    }
}