:root {
    --primary-color: #c45e52;
    --secondary-color: #8b6748;
    --success-color: #9ba888;
    --warning-color: #d47366;
    --danger-color: #a74639;
    --info-color: #b8c5a0;
    --text-primary: #5c3d2e;
    --text-secondary: #8b6748;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f0;
    --border-color: #e8d5bc;
    --shadow-sm: 0 1px 2px 0 rgba(92, 61, 46, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(92, 61, 46, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(92, 61, 46, 0.1);
}

* {
    box-sizing: border-box;
}

.categories-container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 15px;
    min-height: calc(100vh - 120px);
    background: linear-gradient(to bottom,
        var(--elegant-dark) 0%,
        var(--elegant-brown) 50%,
        var(--elegant-dark) 100%
    );
    border-radius: 0;
    position: relative;
    box-sizing: border-box;
}

.categories-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(212,175,55,0.02) 10px, rgba(212,175,55,0.02) 20px);
    pointer-events: none;
    border-radius: 8px;
}

.categories-container h1 {
    color: var(--gold);
    text-align: center;
    margin-bottom: 25px;
    font-size: 2em;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.categories-container h2 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    position: relative;
    z-index: 1;
}

.message-box {
    background-color: #f5f5f0;
    border: 2px solid #c45e52;
    color: #5c3d2e;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9em;
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(92, 61, 46, 0.12);
    margin-bottom: 25px;
    border-top: 4px solid #c45e52;
}

.category-form .form-group {
    margin-bottom: 18px;
}

.category-form label {
    display: block;
    margin-bottom: 6px;
    color: #5c3d2e;
    font-weight: 600;
    font-size: 0.9em;
}

.category-form input[type="text"],
.category-form input[type="number"],
.category-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.category-form input[type="text"]:focus,
.category-form input[type="number"]:focus,
.category-form textarea:focus {
    border-color: #c45e52;
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 94, 82, 0.1);
}

.category-form textarea {
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.btn-primary {
    background-color: #c45e52;
    color: white;
}

.btn-primary:hover {
    background-color: #a74639;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(196, 94, 82, 0.3);
}

.btn-secondary {
    background-color: #8b6748;
    color: white;
}

.btn-secondary:hover {
    background-color: #5c3d2e;
}

.btn-edit {
    background: #d4af37;
    color: white;
}

.btn-edit:hover {
    background: #b8941f;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.btn-toggle {
    background: #9ba888;
    color: white;
}

.btn-toggle:hover {
    background: #8b9977;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(155, 168, 136, 0.3);
}

.btn-delete {
    background: #d47366;
    color: white;
    border: 1.5px solid #a74639;
}

.btn-delete:hover {
    background: #a74639;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(167, 70, 57, 0.4);
}


.categories-list {
    position: relative;
    z-index: 1;
}

.no-data {
    text-align: center;
    color: #8b6748;
    font-style: italic;
    padding: 30px 20px;
    font-size: 0.95em;
}

.table-container {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(92, 61, 46, 0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
}

.categories-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 0.85em;
}

.categories-table thead {
    background-color: #5c3d2e;
    color: white;
}

.categories-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    line-height: 1.5;
}

.categories-table td {
    padding: 12px 8px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
    line-height: 1.5;
}

.categories-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    min-height: 60px;
}

.categories-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(92, 61, 46, 0.1);
}

.categories-table tbody tr:last-child {
    border-bottom: none;
}

.categories-table tbody tr.inactive-row {
    opacity: 0.6;
    background-color: #f5f5f0;
}

.cell-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    min-height: 40px;
}

.btn-action svg,
.btn-action i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-active {
    background-color: #d4dfc8;
    color: #5c3d2e;
    border: 1px solid #9ba888;
}

.status-inactive {
    background-color: #f5e5e0;
    color: #a74639;
    border: 1px solid #d47366;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 3px solid #c45e52;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(196, 94, 82, 0.3);
}

.close {
    color: #8b6748;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #c45e52;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    justify-content: flex-end;
    flex-direction: column;
}

.modal-small .modal-content {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3em;
}

.modal-body {
    margin-bottom: 15px;
}

.modal-body p {
    margin: 10px 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.warning-text {
    color: var(--danger-color);
    font-weight: 600;
    font-size: 0.9em;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-danger:hover {
    background-color: #8b3227;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(167, 70, 57, 0.4);
}


@media (min-width: 640px) {
    .categories-container {
        max-width: 1200px;
        margin: 30px auto;
        padding: 25px;
        border-radius: 10px;
    }

    .categories-container::before {
        border-radius: 10px;
    }

    .categories-container h1 {
        margin-bottom: 30px;
        font-size: 2.5em;
    }

    .categories-container h2 {
        margin-bottom: 22px;
        font-size: 1.75em;
        border-bottom: 3px solid var(--gold);
        padding-bottom: 11px;
    }

    .message-box {
        padding: 14px;
        margin-bottom: 18px;
        font-size: 1em;
    }

    .form-section {
        padding: 25px;
        border-radius: 9px;
        margin-bottom: 32px;
    }

    .category-form .form-group {
        margin-bottom: 19px;
    }

    .category-form label {
        margin-bottom: 7px;
        font-size: 0.92em;
    }

    .category-form input[type="text"],
    .category-form input[type="number"],
    .category-form textarea {
        padding: 11px;
        font-size: 0.98em;
    }

    .form-row {
        flex-direction: row;
        gap: 15px;
        align-items: flex-end;
    }

    .btn {
        padding: 9px 17px;
        font-size: 0.95em;
    }

    .no-data {
        padding: 35px 25px;
        font-size: 1em;
    }

    .categories-table {
        margin-top: 17px;
        font-size: 0.9em;
    }

    .categories-table th,
    .categories-table td {
        padding: 14px 12px;
        font-size: 13px;
    }

    .status-badge {
        padding: 4px 11px;
        font-size: 0.82em;
    }

    .modal-content {
        margin: 8% auto;
        padding: 25px;
        max-width: 550px;
        border-radius: 9px;
    }

    .close {
        font-size: 26px;
    }

    .modal-actions {
        gap: 9px;
        margin-top: 17px;
        flex-direction: row;
    }
}

@media (max-width: 1023px) and (orientation: landscape) {
    .categories-container {
        padding: 10px;
        min-height: auto;
    }

    .categories-container h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .table-container {
        max-height: 50vh;
        overflow-y: auto;
    }
}


@media (min-width: 1024px) {
    .categories-container {
        margin: 40px auto;
        padding: 40px;
        border-radius: 12px;
    }

    .categories-container::before {
        border-radius: 12px;
    }

    .categories-container h1 {
        margin-bottom: 35px;
        font-size: 3em;
    }

    .categories-container h2 {
        margin-bottom: 25px;
        font-size: 2em;
        padding-bottom: 12px;
    }

    .message-box {
        padding: 15px;
        margin-bottom: 20px;
    }

    .form-section {
        padding: 30px;
        border-radius: 10px;
        margin-bottom: 40px;
    }

    .category-form .form-group {
        margin-bottom: 20px;
    }

    .category-form label {
        margin-bottom: 8px;
        font-size: 0.95em;
    }

    .category-form input[type="text"],
    .category-form input[type="number"],
    .category-form textarea {
        padding: 12px;
        font-size: 1em;
    }

    .form-row {
        gap: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    .no-data {
        padding: 40px;
    }

    .categories-table {
        margin-top: 20px;
        font-size: 1em;
    }

    .categories-table th,
    .categories-table td {
        padding: 16px 20px;
        font-size: 14px;
    }

    .categories-table th {
        font-size: 12px;
    }

    .status-badge {
        padding: 5px 12px;
        font-size: 0.85em;
    }

    .modal-content {
        margin: 5% auto;
        padding: 30px;
        max-width: 600px;
        border-radius: 10px;
    }

    .close {
        font-size: 28px;
    }

    .modal-actions {
        gap: 10px;
        margin-top: 20px;
    }
}
