:root {
    --primary: #2d5aa8;
    --primary-light: #4372c4;
    --secondary: #f4f6f9;
    --text-dark: #333;
    --text-muted: #6c757d;
    --white: #ffffff;
    --sidebar-width: 250px;
    --bg-color: #f0f2f5;

    /* Status Colors */
    --status-new: #f39c12; /* Orange */
    --status-progress: #3498db; /* Blue */
    --status-ready: #27ae60; /* Teal/Blueish */
    --status-completed: #8e44ad; /* Purple */
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: linear-gradient(180deg, #2d5aa8 0%, #4372c4 100%);
    color: var(--white);
    padding-top: 1rem;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar .brand {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.75rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar .brand img {
    height: 42px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
    color: var(--white);
    background-color: rgba(255,255,255,0.1);
    border-left: 4px solid var(--white);
}

.sidebar-nav li a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.user-profile-box {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-box img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile-box .info {
    flex-grow: 1;
}

.user-profile-box .info h6 {
    margin: 0;
    font-size: 0.9rem;
}

.user-profile-box .info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

.btn-logout {
    display: block;
    width: calc(100% - 3rem);
    margin: 1rem 1.5rem;
    position: absolute;
    bottom: 0;
    text-align: center;
    background: rgba(0,0,0,0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(0,0,0,0.3);
    color: white;
}


/* Main Content */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .main-wrapper {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.welcome-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.welcome-text i {
    color: #f1c40f;
    margin-right: 10px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 20px;
    border: 1px solid #ddd;
    width: 250px;
    outline: none;
}

.search-bar i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.action-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.action-icon .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
}

.topbar-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dashboard Cards (Stat Widgets) */
.stat-card {
    border-radius: 10px;
    padding: 1rem 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.stat-card.orange { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-card.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-card.green { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.stat-card.purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.stat-card.teal { background: linear-gradient(135deg, #1abc9c, #16a085); }
.stat-card.pink { background: linear-gradient(135deg, #fd79a8, #e84393); }

.stat-card .inner {
    position: relative;
    z-index: 2;
}

.stat-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card .h1 {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 0;
}

.stat-card .icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.3;
    z-index: 1;
}

.stat-card .bottom-action {
    display: block;
    text-align: center;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.3rem;
    margin-top: 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.3s;
}

.stat-card .bottom-action:hover {
    background: rgba(255,255,255,0.3);
}

/* Content Cards */
.content-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 1.5rem;
    border: 1px solid #eaeaea;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.card-title-custom {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.btn-view-all {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-view-all:hover {
    color: var(--primary);
}

/* Tables */
.table-custom {
    width: 100%;
    margin-bottom: 0;
}

.table-custom th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid #f0f0f0;
    padding: 0.75rem 0.5rem;
}

.table-custom td {
    padding: 1rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.95rem;
}

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

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    display: inline-block;
}

.status-badge.new { background-color: var(--status-new); }
.status-badge.progress { background-color: var(--status-progress); }
.status-badge.ready { background-color: var(--status-ready); }
.status-badge.completed { background-color: var(--status-completed); }

/* Design Gallery */
.design-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.design-item {
    min-width: 100px;
    text-align: center;
}

.design-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    margin-bottom: 0.5rem;
}

.design-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.embroidery-bg {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(45, 90, 168, 0.18), transparent 50%),
        radial-gradient(900px 500px at 110% 10%, rgba(26, 188, 156, 0.14), transparent 55%),
        radial-gradient(900px 500px at 40% 120%, rgba(142, 68, 173, 0.12), transparent 55%),
        linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 1.25rem;
}

.auth-card {
    width: min(720px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.08);
    overflow: hidden;
}

.auth-card-header {
    padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
    letter-spacing: 0.2px;
}

.auth-subtitle {
    margin: 0.25rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-card-body {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
}

.emb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    background: linear-gradient(135deg, #2d5aa8, #1abc9c);
}

.machine-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.machine-card {
    grid-column: span 12;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    background: #fff;
    padding: 0.9rem 1rem;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

@media (min-width: 992px) {
    .machine-card.half { grid-column: span 6; }
    .machine-card.third { grid-column: span 4; }
}

.machine-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.6rem;
}

.machine-title {
    font-weight: 800;
    margin: 0;
    font-size: 0.95rem;
}

.machine-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.machine-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
    overflow: hidden;
}

.machine-bar > div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2d5aa8, #1abc9c);
}

.work-stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 575.98px) {
    .work-stepper { grid-template-columns: repeat(2, 1fr); }
}

.work-step {
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 0.75rem 0.75rem;
    background: rgba(255,255,255,0.9);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.work-step.active {
    border-color: rgba(45, 90, 168, 0.45);
    box-shadow: 0 10px 22px rgba(45, 90, 168, 0.12);
    transform: translateY(-1px);
}

.work-step .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    background: rgba(0,0,0,0.18);
}

.work-step.active .dot {
    background: linear-gradient(180deg, #2d5aa8, #1abc9c);
}

.work-step .label {
    font-weight: 800;
    font-size: 0.88rem;
    margin: 0;
}

.work-step .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.1rem 0 0 0;
}
