/* ========================================
   ZARA Style Catering Procurement System
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #FFFFFF;
    color: #000000;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

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

ul, ol {
    list-style: none;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* ========================================
   Typography
   ======================================== */

h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 16px;
    font-weight: 500;
}

.text-body {
    font-size: 14px;
    font-weight: 400;
}

.text-small {
    font-size: 12px;
    font-weight: 400;
}

.text-gray {
    color: #616161;
}

.text-light {
    color: #9E9E9E;
}

.text-success {
    color: #00C853;
}

.text-danger {
    color: #FF5252;
}

/* ========================================
   Layout
   ======================================== */

.page-container {
    min-height: 100vh;
    padding-bottom: 76px;
}

.page-margin {
    padding-left: 20px;
    padding-right: 20px;
}

.module-gap {
    margin-top: 32px;
}

.element-gap {
    margin-top: 16px;
}

/* ========================================
   Header
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-bottom: 1px solid #E0E0E0;
}

.header-left,
.header-right {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left {
    left: 12px;
}

.header-right {
    right: 12px;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
}

.header-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 4px;
}

.header-icon:active {
    background: #F5F5F5;
}

.header-icon svg {
    width: 20px;
    height: 20px;
    stroke: #000000;
    fill: none;
    stroke-width: 2;
}

/* ========================================
   Bottom Navigation
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #E0E0E0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    opacity: 0.6;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: #9E9E9E;
    fill: none;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}

.nav-item span {
    font-size: 10px;
    color: #9E9E9E;
    transition: color 0.3s ease;
}

.nav-item.active svg {
    stroke: #000000;
}

.nav-item.active span {
    color: #000000;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: #FFFFFF;
    border-radius: 4px;
    padding: 20px;
    transition: background 0.3s ease;
}

.card:active {
    background: #F5F5F5;
}

.card-link {
    display: block;
    cursor: pointer;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: #000000;
    color: #FFFFFF;
}

.btn-primary:active {
    background: #333333;
}

.btn-outline {
    background: transparent;
    border: 1px solid #000000;
    color: #000000;
}

.btn-outline:active {
    background: #F5F5F5;
}

.btn-text {
    background: transparent;
    color: #000000;
    height: auto;
    padding: 8px;
}

.btn-text:active {
    background: #F5F5F5;
}

.btn-danger {
    background: #FF5252;
    color: #FFFFFF;
}

.btn-danger:active {
    background: #D32F2F;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
}

/* ========================================
   Form Elements
   ======================================== */

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

.form-label {
    display: block;
    font-size: 12px;
    color: #9E9E9E;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 48px;
    border-bottom: 1px solid #E0E0E0;
    padding: 0;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: transparent;
}

.form-input::placeholder {
    color: #9E9E9E;
}

.form-input:focus {
    border-bottom-color: #000000;
}

.form-input-underline {
    border: none;
    border-bottom: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
}

.form-input-underline:focus {
    border-bottom-width: 2px;
    border-bottom-color: #000000;
}

/* Select */
.form-select {
    width: 100%;
    height: 48px;
    border-bottom: 1px solid #E0E0E0;
    padding: 0;
    font-size: 14px;
    background: transparent;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23616161' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.form-select:focus {
    border-bottom-color: #000000;
}

/* Number Input */
.number-input {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.number-input button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
    cursor: pointer;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.number-input button:active {
    background: #E0E0E0;
}

.number-input button svg {
    width: 16px;
    height: 16px;
    stroke: #000000;
    stroke-width: 2;
}

.number-input input {
    width: 48px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #E0E0E0;
    border-right: 1px solid #E0E0E0;
    font-size: 14px;
}

/* ========================================
   Search Bar
   ======================================== */

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #E0E0E0;
}

.search-bar svg {
    width: 20px;
    height: 20px;
    stroke: #9E9E9E;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    height: 24px;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: #9E9E9E;
}

/* ========================================
   Filter Tags
   ======================================== */

.filter-tags {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 16px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-tags::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FFFFFF;
    -webkit-tap-highlight-color: transparent;
}

.filter-tag:active {
    background: #F5F5F5;
}

.filter-tag.active {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
}

/* ========================================
   List Items
   ======================================== */

.list-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
    transition: background 0.3s ease;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:active {
    background: #F5F5F5;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 12px;
    color: #9E9E9E;
    margin-top: 4px;
}

.list-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.list-item-value {
    font-size: 14px;
    color: #00C853;
    font-weight: 500;
}

.list-item-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-arrow svg {
    width: 16px;
    height: 16px;
    stroke: #9E9E9E;
    fill: none;
    stroke-width: 2;
}

/* ========================================
   Product Item
   ======================================== */

.product-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item:active {
    background: #F5F5F5;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.product-thumb {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb svg {
    width: 24px;
    height: 24px;
    stroke: #9E9E9E;
    fill: none;
    stroke-width: 1.5;
}

.product-info {
    flex: 1;
    margin-left: 16px;
    min-width: 0;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
}

.product-spec {
    font-size: 12px;
    color: #9E9E9E;
    margin-top: 4px;
}

.product-supplier {
    font-size: 12px;
    color: #00C853;
    margin-bottom: 2px;
}

.product-price {
    font-size: 14px;
    color: #00C853;
    font-weight: 500;
    margin-left: 16px;
}

/* ========================================
   Quick Actions Grid
   ======================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #F5F5F5;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.quick-action:active {
    background: #E0E0E0;
}

.quick-action svg {
    width: 32px;
    height: 32px;
    stroke: #000000;
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 12px;
}

.quick-action span {
    font-size: 12px;
    color: #000000;
    text-align: center;
}

/* ========================================
   Status Card
   ======================================== */

.status-card {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 24px 20px;
}

.status-card-value {
    font-size: 32px;
    font-weight: 600;
    color: #000000;
    line-height: 1.2;
}

.status-card-label {
    font-size: 14px;
    color: #616161;
    margin-top: 8px;
}

/* ========================================
   Order Table
   ======================================== */

.order-table {
    width: 100%;
}

.order-table-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px 80px;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #E0E0E0;
    font-size: 12px;
    color: #9E9E9E;
}

.order-table-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 80px;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #F5F5F5;
    align-items: center;
}

.order-table-row:last-child {
    border-bottom: none;
}

.order-product {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-product-name {
    font-size: 14px;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-product-spec {
    font-size: 12px;
    color: #9E9E9E;
}

.order-table-cell {
    font-size: 14px;
    text-align: center;
}

.order-table-cell input {
    width: 100%;
    height: 32px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.order-table-cell input:focus {
    border-color: #000000;
}

.order-subtotal {
    color: #00C853;
    font-weight: 500;
}

.order-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.order-delete svg {
    width: 18px;
    height: 18px;
    stroke: #FF5252;
    fill: none;
    stroke-width: 2;
}

/* ========================================
   Print Preview
   ======================================== */

.print-preview {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 20px;
    margin: 16px 0;
}

.print-paper {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 32px;
    margin: 0 auto;
    max-width: 100%;
    aspect-ratio: 210 / 297;
}

.print-template-card {
    width: 120px;
    height: 160px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

.print-template-card.active {
    border-color: #000000;
}

.print-template-card span {
    font-size: 12px;
    color: #9E9E9E;
}

.template-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Bottom Bar
   ======================================== */

.bottom-bar {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #E0E0E0;
    z-index: 99;
}

.bottom-bar-total {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bottom-bar-total-label {
    font-size: 12px;
    color: #9E9E9E;
}

.bottom-bar-total-value {
    font-size: 24px;
    font-weight: 600;
    color: #00C853;
}

/* ========================================
   Login Page
   ======================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.login-logo {
    margin-top: 80px;
    text-align: center;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #000000;
}

.login-logo p {
    font-size: 12px;
    color: #9E9E9E;
    margin-top: 8px;
    letter-spacing: 1px;
}

.login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 80px;
}

.login-form .form-group {
    margin-bottom: 32px;
}

.login-footer {
    text-align: center;
    padding-bottom: 32px;
}

.login-footer p {
    font-size: 12px;
    color: #9E9E9E;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: #E0E0E0;
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
    color: #9E9E9E;
}

/* ========================================
   Page Content
   ======================================== */

.page-content {
    padding-top: 60px;
}

/* ========================================
   Utility Classes
   ======================================== */

.flex {
    display: flex;
}

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

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

.flex-1 {
    flex: 1;
}

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

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-32 {
    margin-top: 32px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.p-16 {
    padding: 16px;
}

.p-20 {
    padding: 20px;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

/* ========================================
   Animations
   ======================================== */

.page-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ========================================
   Modal / Overlay
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: 16px 16px 0 0;
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal.active {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #F5F5F5;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #F5F5F5;
}

/* ========================================
   Swipe Actions
   ======================================== */

.swipe-item {
    position: relative;
    overflow: hidden;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.swipe-item.swiped .swipe-actions {
    transform: translateX(0);
}

.swipe-delete {
    width: 80px;
    height: 100%;
    background: #FF5252;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 14px;
}

/* ========================================
   Toast
   ======================================== */

.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #000000;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Image Upload
   ======================================== */

.image-upload {
    width: 100%;
    aspect-ratio: 1;
    background: #F5F5F5;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    overflow: hidden;
}

.image-upload:active {
    background: #E0E0E0;
}

.image-upload svg {
    width: 48px;
    height: 48px;
    stroke: #9E9E9E;
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 12px;
}

.image-upload span {
    font-size: 14px;
    color: #9E9E9E;
}

.image-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
