:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --secondary-hover: #5c636a;
    --success-color: #198754;
    --success-hover: #157347;
    --danger-color: #dc3545;
    --danger-hover: #bb2d3b;
    --warning-color: #ffc107;
    --warning-hover: #ffb800;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    justify-content: center;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.btn-login {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

h2:first-of-type {
    margin-top: 0;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="email"] {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    opacity: 0.85;
}

button:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

.delete-btn {
    background-color: var(--danger-color);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

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

.edit-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

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

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-buttons form {
    display: inline;
    margin: 0;
}

.back-btn {
    background-color: var(--secondary-color);
    color: var(--white);
}

.back-btn:hover {
    background-color: var(--secondary-hover);
}

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-info {
    color: #055160;
    background-color: #cfe2ff;
    border-color: #b6d4fe;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: larger;
    font-weight: 600;
}

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

tr:hover {
    background-color: #f8f9fa;
}

tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

tr.clickable-row:hover {
    background-color: #e9ecef;
}

.purchased-table {
    opacity: 0.85;
}

.purchased-table img {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Images */
.img-container {
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 0.5rem;
}

img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .title {
        width: 100%;
        justify-content: center;
        order: 2;
    }

    .btn-login {
        order: 1;
        align-self: flex-start;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .table-responsive {
        border-radius: 0;
    }

    table thead {
        display: none;
    }

    table tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1rem;
        overflow: hidden;
    }

    table td {
        display: block;
        text-align: right;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-left: 50%;
    }

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

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        font-weight: 600;
        color: var(--text-color);
        text-align: left;
        text-transform: uppercase;
        font-size: 0.75rem;
    }

    .img-container {
        width: 120px;
        height: 120px;
    }

    .action-buttons {
        justify-content: center;
        margin-top: 0.5rem;
    }

    td[data-label="Action"] {
        text-align: center;
        padding-right: 1rem;
    }

    td[data-label="Action"]::before {
        display: none;
    }

    input[type="text"],
    input[type="password"],
    input[type="url"],
    input[type="number"],
    input[type="email"] {
        width: 100%;
    }

    button {
        width: 100%;
    }

    .action-buttons button,
    .action-buttons a {
        width: 48%;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 10px 0;
    }

    .container {
        padding: 0 10px;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    th, td {
        padding: 0.75rem;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .title h1 {
        font-size: 1.25rem;
    }

    .img-container {
        width: 100px;
        height: 100px;
    }
}