/* ===== Base ===== */
:root {
    --sidebar-width: 240px;
}

body {
    background-color: #f4f6fb;
    color: #1a1d23;
}

/* ===== Login ===== */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

/* ===== Navbar ===== */
.navbar-brand {
    letter-spacing: -0.3px;
}
.navbar .nav-link {
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,0.12);
}

/* ===== Stat cards ===== */
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== Cards ===== */
.card {
    border-radius: 12px;
}

/* ===== Tables ===== */
.table > :not(caption) > * > th,
.table > :not(caption) > * > td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}
.table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    white-space: nowrap;
}

/* ===== Pagination ===== */
.page-link {
    border-radius: 6px !important;
    margin: 0 2px;
}

/* ===== Modals ===== */
.modal-content {
    border-radius: 14px;
    border: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* ===== Toast container ===== */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.app-toast {
    background: #1a1d23;
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: toastIn 0.25s ease;
}
.app-toast.success { border-left: 4px solid #28a745; }
.app-toast.danger  { border-left: 4px solid #dc3545; }
.app-toast.warning { border-left: 4px solid #ffc107; }
.app-toast.info    { border-left: 4px solid #0dcaf0; }

@keyframes toastIn {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ===== Color Swatches ===== */
.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.12s, border-color 0.12s;
}
.color-swatch:hover {
    transform: scale(1.18);
}
.color-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px #1a1d23, 0 0 0 4px currentColor;
    transform: scale(1.12);
}

/* ===== Machine Cover Image ===== */
.machine-cover {
    width: 100%;
    height: 110px;
    background-size: cover;
    background-position: center;
}
.machine-cover-empty {
    height: 70px;
}

/* ===== Board / Kanban ===== */
.board-container {
    overflow-x: auto;
    min-height: calc(100vh - 180px);
    padding-bottom: 32px;
    align-items: flex-start;
}

.board-column {
    width: 280px;
    min-width: 280px;
}

.board-column-header {
    user-select: none;
}

.board-column-body {
    min-height: 120px;
    transition: background 0.15s;
}

.board-column-body.sortable-drag-over {
    background: #d0e8ff;
}

/* ===== Order Cards ===== */
.order-card {
    cursor: grab;
    border-radius: 10px !important;
    transition: box-shadow 0.15s, transform 0.15s;
    border: 1px solid rgba(0,0,0,0.06) !important;
}
.order-card:active {
    cursor: grabbing;
}
.order-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
    transform: translateY(-1px);
}

/* Hover actions overlay */
.order-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    gap: 4px;
    z-index: 10;
}
.order-card:hover .order-card-actions {
    display: flex;
}
.order-card-actions .btn {
    padding: 2px 7px;
    font-size: 0.75rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
}

/* Sortable states */
.sortable-ghost {
    opacity: 0.4;
    background: #c8e6ff !important;
    border: 2px dashed #0d6efd !important;
}
.sortable-drag {
    opacity: 0.95;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2) !important;
    transform: scale(1.02);
}

/* ===== Misc ===== */
.min-w-0 { min-width: 0; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .board-column { width: 240px; min-width: 240px; }
    .container-fluid { padding: 0 12px; }
}

/* ===== Footer ===== */
.footer {
    margin-top: 40px;
}
