/* =========================================================
   Lilo-ere6
   Main Stylesheet
   app/static/css/style.css
   ========================================================= */

/* =========================================================
   1. RESET
   ========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Tahoma,
        Arial,
        sans-serif;

    direction: rtl;
    text-align: right;

    background: #f3f1ed;
    color: #292621;

    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* =========================================================
   2. CSS VARIABLES
   ========================================================= */

:root {
    --primary: #6b4226;
    --primary-dark: #4a2d1a;
    --primary-light: #8a5a35;

    --secondary: #8c8c8c;
    --secondary-dark: #5f5f5f;
    --secondary-light: #c8c8c8;

    --wood-light: #d8b58a;
    --wood: #9a6b3f;
    --wood-dark: #634021;

    --metal-light: #e5e5e5;
    --metal: #9c9c9c;
    --metal-dark: #444444;

    --background: #f3f1ed;
    --surface: #ffffff;
    --surface-soft: #f8f7f5;

    --text: #292621;
    --text-light: #706c65;
    --text-muted: #96918a;

    --border: #ddd8d0;

    --success: #2f7d4a;
    --success-light: #e7f4eb;

    --warning: #b97816;
    --warning-light: #fff3dc;

    --danger: #b33a32;
    --danger-light: #fae8e6;

    --info: #35739c;
    --info-light: #e7f2f8;

    --sidebar-width: 270px;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm:
        0 2px 8px rgba(0, 0, 0, 0.06);

    --shadow:
        0 5px 20px rgba(0, 0, 0, 0.08);

    --shadow-lg:
        0 10px 35px rgba(0, 0, 0, 0.12);

    --transition:
        0.2s ease;
}


/* =========================================================
   3. CONTAINER
   ========================================================= */

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


/* =========================================================
   4. HEADER
   ========================================================= */

.main-header {
    min-height: 70px;

    background:
        linear-gradient(
            135deg,
            var(--wood-dark),
            var(--primary),
            var(--primary-light)
        );

    color: #fff;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.15);

    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;

    font-size: 22px;
    font-weight: 800;

    letter-spacing: 0.3px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    padding: 8px 14px;

    border-radius: var(--radius-sm);

    transition:
        background var(--transition),
        color var(--transition);
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username {
    font-size: 14px;
    opacity: 0.95;
}

.logout-btn {
    padding: 7px 14px;

    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);

    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* =========================================================
   5. SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    right: 0;

    width: var(--sidebar-width);
    height: 100vh;

    background:
        linear-gradient(
            180deg,
            #3e2819 0%,
            #51331f 45%,
            #2f2117 100%
        );

    color: #fff;

    display: flex;
    flex-direction: column;

    z-index: 1100;

    box-shadow:
        -4px 0 18px rgba(0, 0, 0, 0.18);

    overflow-y: auto;
}

.sidebar-header {
    padding: 22px 20px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 20px;
    font-weight: 800;
}

.logo-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--wood-light);
    color: var(--wood-dark);

    font-weight: 900;

    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.sidebar-user {
    margin: 18px 14px;
    padding: 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    background:
        rgba(255, 255, 255, 0.07);

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: var(--radius);
}

.user-avatar {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--wood-light);
    color: var(--wood-dark);

    font-size: 17px;
    font-weight: 800;
}

.user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.user-info strong {
    font-size: 14px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info small {
    margin-top: 2px;

    color: rgba(255, 255, 255, 0.62);

    font-size: 11px;
}

.sidebar-nav {
    flex: 1;

    padding: 8px 12px 20px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;

    padding: 0 12px 8px;

    color: rgba(255, 255, 255, 0.42);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.3px;
}

.nav-item {
    min-height: 44px;

    margin-bottom: 4px;
    padding: 10px 13px;

    display: flex;
    align-items: center;

    gap: 11px;

    border-radius: 8px;

    color: rgba(255, 255, 255, 0.76);

    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);
}

.nav-item:hover {
    color: #fff;

    background:
        rgba(255, 255, 255, 0.09);

    transform: translateX(-2px);
}

.nav-item.active {
    color: #fff;

    background:
        linear-gradient(
            90deg,
            rgba(216, 181, 138, 0.22),
            rgba(216, 181, 138, 0.08)
        );

    border-right:
        3px solid var(--wood-light);
}

.nav-icon {
    width: 25px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 17px;
}

.nav-text {
    font-size: 13px;
}

.logout-item {
    color: #e8aaa5;
}

.logout-item:hover {
    color: #fff;

    background:
        rgba(179, 58, 50, 0.2);
}

.sidebar-footer {
    padding: 15px 18px;

    border-top:
        1px solid rgba(255, 255, 255, 0.1);

    display: flex;
    justify-content: space-between;
    align-items: center;

    color: rgba(255, 255, 255, 0.45);

    font-size: 11px;
}


/* =========================================================
   6. MAIN CONTENT
   ========================================================= */

.main-content {
    min-height: calc(100vh - 70px);

    padding: 30px;

    margin-right: var(--sidebar-width);

    background:
        linear-gradient(
            135deg,
            #f6f4f0,
            #ece9e3
        );
}


/* =========================================================
   7. PAGE HEADER
   ========================================================= */

.page-header {
    margin-bottom: 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.page-title {
    color: var(--primary-dark);

    font-size: 26px;
    font-weight: 800;
}

.page-subtitle {
    margin-top: 4px;

    color: var(--text-light);

    font-size: 13px;
}


/* =========================================================
   8. CARDS
   ========================================================= */

.card {
    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    overflow: hidden;
}

.card-header {
    padding: 18px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom:
        1px solid var(--border);

    background:
        linear-gradient(
            180deg,
            #fff,
            #faf9f7
        );
}

.card-title {
    color: var(--primary-dark);

    font-size: 16px;
    font-weight: 800;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;

    border-top:
        1px solid var(--border);

    background: var(--surface-soft);
}


/* =========================================================
   9. DASHBOARD GRID
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 25px;
}

.stat-card {
    padding: 20px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);

    box-shadow: var(--shadow);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;
}

.stat-label {
    color: var(--text-light);

    font-size: 12px;
}

.stat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eee7df;

    color: var(--primary);

    font-size: 19px;
}

.stat-value {
    color: var(--primary-dark);

    font-size: 28px;
    font-weight: 900;

    line-height: 1.2;
}

.stat-change {
    margin-top: 8px;

    font-size: 11px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}


/* =========================================================
   10. BUTTONS
   ========================================================= */

.btn {
    min-height: 40px;

    padding: 8px 17px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-size: 13px;
    font-weight: 700;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary-dark);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-outline {
    background: transparent;

    border-color: var(--border);

    color: var(--text);
}

.btn-outline:hover {
    background: var(--surface-soft);
}

.btn-sm {
    min-height: 34px;

    padding: 6px 11px;

    font-size: 11px;
}

.btn-lg {
    min-height: 46px;

    padding: 10px 22px;

    font-size: 14px;
}


/* =========================================================
   11. FORMS
   ========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 13px;
    font-weight: 700;
}

.form-control,
.form-select,
.form-input {
    width: 100%;

    min-height: 42px;

    padding: 9px 12px;

    background: #fff;

    border:
        1px solid var(--border);

    border-radius: var(--radius-sm);

    color: var(--text);

    font-size: 13px;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus,
.form-input:focus {
    border-color: var(--primary-light);

    box-shadow:
        0 0 0 3px rgba(138, 90, 53, 0.12);
}

textarea.form-control {
    min-height: 110px;

    resize: vertical;
}

.form-help {
    display: block;

    margin-top: 5px;

    color: var(--text-muted);

    font-size: 11px;
}

.form-error {
    display: block;

    margin-top: 5px;

    color: var(--danger);

    font-size: 11px;
}


/* =========================================================
   12. TABLES
   ========================================================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background: #fff;
}

.table {
    width: 100%;

    border-collapse: collapse;

    min-width: 700px;

    font-size: 12px;
}

.table th,
.table td {
    padding: 13px 14px;

    text-align: right;

    border-bottom:
        1px solid #ece8e2;
}

.table th {
    background:
        linear-gradient(
            180deg,
            #f0ece6,
            #e8e3dc
        );

    color: var(--primary-dark);

    font-weight: 800;

    white-space: nowrap;
}

.table tbody tr {
    transition:
        background var(--transition);
}

.table tbody tr:hover {
    background: #faf8f5;
}

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


/* =========================================================
   13. BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 65px;

    padding: 4px 9px;

    border-radius: 30px;

    font-size: 10px;
    font-weight: 700;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-secondary {
    background: #eeeeee;
    color: #666;
}


/* =========================================================
   14. ALERTS
   ========================================================= */

.flash-messages {
    margin-bottom: 20px;
}

.alert {
    margin-bottom: 10px;

    padding: 13px 16px;

    border-radius: var(--radius-sm);

    border: 1px solid transparent;

    font-size: 13px;
}

.alert-success {
    background: var(--success-light);

    border-color: #c9e7d2;

    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);

    border-color: #f2dcae;

    color: var(--warning);
}

.alert-danger,
.alert-error {
    background: var(--danger-light);

    border-color: #efc4c0;

    color: var(--danger);
}

.alert-info {
    background: var(--info-light);

    border-color: #c9e0ec;

    color: var(--info);
}


/* =========================================================
   15. FOOTER
   ========================================================= */

.main-footer {
    margin-right: var(--sidebar-width);

    padding: 20px 30px;

    background: #e8e4de;

    border-top:
        1px solid var(--border);

    color: var(--text-muted);

    text-align: center;

    font-size: 11px;
}


/* =========================================================
   16. LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        linear-gradient(
            135deg,
            #4a2d1a,
            #8a5a35
        );
}

.login-container {
    width: 100%;
    max-width: 430px;
}

.login-card {
    padding: 35px;

    background: #fff;

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);
}

.login-logo {
    margin-bottom: 25px;

    text-align: center;
}

.login-logo h1 {
    color: var(--primary-dark);

    font-size: 27px;
    font-weight: 900;
}

.login-logo p {
    margin-top: 5px;

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   17. SEARCH
   ========================================================= */

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;

    left: 12px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);
}


/* =========================================================
   18. PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-top: 20px;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 8px;

    border:
        1px solid var(--border);

    border-radius: var(--radius-sm);

    background: #fff;

    font-size: 11px;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);

    border-color: var(--primary);

    color: #fff;
}


/* =========================================================
   19. PROGRESS
   ========================================================= */

.progress {
    width: 100%;
    height: 9px;

    overflow: hidden;

    background: #e7e3dd;

    border-radius: 30px;
}

.progress-bar {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--primary-dark),
            var(--wood-light)
        );

    border-radius: inherit;

    transition: width 0.3s ease;
}


/* =========================================================
   20. PRODUCT
   ========================================================= */

.product-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}

.product-card {
    overflow: hidden;

    background: #fff;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);

    box-shadow: var(--shadow);
}

.product-image {
    width: 100%;
    height: 190px;

    object-fit: cover;

    background: #eee;
}

.product-content {
    padding: 17px;
}

.product-title {
    color: var(--primary-dark);

    font-size: 15px;
    font-weight: 800;
}

.product-description {
    margin-top: 7px;

    color: var(--text-light);

    font-size: 11px;
}

.product-price {
    margin-top: 12px;

    color: var(--primary);

    font-size: 17px;
    font-weight: 900;
}


/* =========================================================
   21. ORDER
   ========================================================= */

.order-status {
    display: inline-flex;
    align-items: center;

    gap: 6px;
}

.order-status::before {
    content: "";

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: currentColor;
}


/* =========================================================
   22. MACHINE STATUS
   ========================================================= */

.machine-status {
    display: flex;
    align-items: center;

    gap: 7px;

    font-size: 11px;
    font-weight: 700;
}

.machine-status::before {
    content: "";

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: currentColor;
}

.machine-status.online {
    color: var(--success);
}

.machine-status.warning {
    color: var(--warning);
}

.machine-status.offline {
    color: var(--danger);
}


/* =========================================================
   23. MODAL
   ========================================================= */

.modal {
    position: fixed;

    inset: 0;

    z-index: 3000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.55);
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 600px;

    max-height: 90vh;

    overflow-y: auto;

    background: #fff;

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 18px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom:
        1px solid var(--border);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;

    display: flex;
    justify-content: flex-start;

    gap: 8px;

    border-top:
        1px solid var(--border);
}


/* =========================================================
   24. EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 50px 20px;

    text-align: center;

    color: var(--text-muted);
}

.empty-state-icon {
    margin-bottom: 12px;

    font-size: 40px;
}

.empty-state-title {
    color: var(--text-light);

    font-size: 16px;
    font-weight: 800;
}

.empty-state-text {
    margin-top: 5px;

    font-size: 12px;
}


/* =========================================================
   25. UTILITIES
   ========================================================= */

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.mt-1 {
    margin-top: 5px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-1 {
    margin-bottom: 5px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 15px;
}

.mb-4 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 5px;
}

.gap-2 {
    gap: 10px;
}

.gap-3 {
    gap: 15px;
}

.hidden {
    display: none !important;
}


/* =========================================================
   26. SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #eeeae4;
}

::-webkit-scrollbar-thumb {
    background: #aaa39b;

    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #817a72;
}


/* =========================================================
   END
   ========================================================= */
