:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --nav-bg: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body, html {
    margin: 0;
    padding: 0;
    background: var(--bg-color) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    scroll-behavior: smooth;
}

/* Header & Nav modernization */
body > nav {
    padding: 0;
    line-height: normal;
}

body > nav > div {
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

body > nav > div > a {
    color: #f1f5f9;
    padding: 1rem 1.25rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

body > nav > div > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body > nav > div > a.active {
    background: var(--primary-color);
}

/* Layout */
#content {
    display: flex;
    width: 100%;
    margin: 0;
    min-height: 80vh;
}

.sidebar-column {
    width: 280px;
    flex-shrink: 0;
    padding: 2rem 1.5rem;
    background: white;
    border-right: 1px solid var(--border-color);
}

.main-content-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.content-inner {
    max-width: 1000px;
    width: 100%;
}

.container.main {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

/* Sidebar Navigation */
.navtypes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.navtypes > * {
    text-align: left;
    display: flex;
    align-items: center;
    width: 100%;
    height: auto;
    line-height: 1.5;
    float: none;
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-main);
    background-color: transparent;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: 0;
}

.navtypes > *:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
    transform: translateX(4px);
}

.navtypes > a.active {
    background-color: var(--primary-color);
    color: white;
}

.navtypes > a > img {
    height: 24px;
    width: 24px;
    margin-right: 12px;
    border-radius: 4px;
    float: none;
}

/* Cards (Thumbnails) */
.thumbnail {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.thumbnail:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.thumbnail img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.thumbnail .caption {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.thumbnail h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.thumbnail .badge {
    background-color: var(--secondary-color);
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 2rem;
}

/* Admin Catalog Styles */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.catalog > div > div {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.catalog > div > div:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.catalog img.remove {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.catalog img.remove:hover {
    opacity: 1;
}

.catalog .rtop {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.catalog .price, .catalog .amount {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.catalog .price {
    color: var(--primary-color);
    background: #eef2ff;
}

.catalog .name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.catalog .img {
    text-align: center;
    margin-bottom: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1rem;
}

.catalog .img > img {
    max-width: 100%;
    height: 120px;
    object-fit: contain;
}

#bigcatmenu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

#bigcatmenu > a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

#bigcatmenu > a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#bigcatmenu img {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* UI Elements */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

.updater_submit {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.updater_submit:hover {
    filter: brightness(1.1);
}

/* Product Detail Table Refresh */
table#unit {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

table#unit tr > td {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.6;
}

table#unit tr:last-child > td {
    border-bottom: none;
}

table#unit tr > td:first-child {
    font-weight: 600;
    color: var(--text-muted);
    width: 30%;
    background: #f8fafc;
}

/* Footer Modernization */
footer {
    background-color: var(--nav-bg);
    color: #cbd5e1;
    padding: 4rem 0 2rem 0;
    margin-top: 4rem;
    font-size: 0.95rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 3rem;
}

.footer-column h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: white;
}

.footer-info p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0 auto;
    padding: 2rem 2rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Misc */
h2 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: left;
}

button {
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

input, select, textarea {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Orders Table Styles */
.orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.orders-table th {
    background: #f8fafc;
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.orders-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

.orders-table tr.new { background-color: #ffffff; }
.orders-table tr.progress { background-color: #f0f9ff; }
.orders-table tr.complete { background-color: #f0fdf4; }
.orders-table tr.broken { background-color: #fef2f2; }

.orders-table tr:hover {
    filter: brightness(0.98);
}

.status-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.new .status-select { border-color: var(--primary-color); color: var(--primary-color); }
.progress .status-select { border-color: #0ea5e9; color: #0ea5e9; }
.complete .status-select { border-color: var(--secondary-color); color: var(--secondary-color); }
.broken .status-select { border-color: #ef4444; color: #ef4444; }