@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #ead5ca;
    min-height: 100vh;
    padding: 25px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 25px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.coffee-icon {
    font-size: 50px;
}

.brand {
    font-size: 12px;
    color: #a08070;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.header-text h1 {
    font-size: 28px;
    color: #6b4423;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.top-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
    grid-auto-rows: auto;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: inline-block;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: #6b4423;
    margin-bottom: 15px;
}

/* Left Column - Today Section */
.left-column {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.today-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 22px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.today-card .card-label {
    display: block;
    margin-bottom: 15px;
}

.today-card canvas {
    flex-grow: 1;
    max-height: 250px;
}

.metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.metric-item {
    padding: 25px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.large-brown {
    background: #8b6344;
    color: white;
    border-radius: 0;
}

.target-box {
    background: #dfe9f7;
    border-radius: 0;
    border-left: 1px solid #c5e3f6;
}

.target-box .metric-value {
    color: #6b4423;
}

.target-box .metric-label {
    color: #999;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1;
}

.metric-label {
    font-size: 12px;
    color: inherit;
    font-weight: 500;
    opacity: 0.85;
}

/* Small Metrics Row */
.metric-row-small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.small-metric {
    padding: 20px 22px;
}

.small-metric .metric-value {
    font-size: 22px;
    margin-bottom: 4px;
    color: #8b6344;
}

.small-metric .metric-label {
    font-size: 12px;
    color: #888;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 10px;
    text-transform: capitalize;
}

.badge.excellent {
    background: #66bb6a;
    color: white;
}

.badge.careful {
    background: #ff9966;
    color: white;
}

.badge.good {
    background: #90ee90;
    color: white;
}

.badge.good-sm {
    background: #90ee90;
    color: white;
    margin-top: 0;
}

.badge.excellent-sm {
    background: #66bb6a;
    color: white;
    margin-top: 0;
}

/* Orders Card */
.orders-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 200px;
}

.view-customers-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #6b4423;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.view-customers-btn:hover {
    background: #5a3818;
}

.orders-card .metric-value {
    font-size: 56px;
    color: #8b6344;
    margin-top: 15px;
}

.orders-card .card-label {
    margin-bottom: 0;
}

/* Payment Card */
.payment-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.payment-card .card-title {
    margin-bottom: 12px;
}

.payment-card canvas {
    flex-grow: 1;
    max-height: 180px;
}

/* Top Products */
.top-products {
    min-height: 280px;
}

.legend {
    display: flex;
    gap: 25px;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 1px;
}

.legend-dot.brown {
    background: #8b6344;
}

.legend-dot.red {
    background: #d32f2f;
}

.top-products canvas {
    max-height: 220px;
}

/* Center Column */
.center-column {
    grid-column: 2;
}

.metric-row-top {
    margin-bottom: 0;
}

.metric-top {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Right Column - Metrics */
.right-column {
    grid-column: 3;
}

.metric-cards-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 22px;
    gap: 15px;
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.metric-card .metric-label {
    font-size: 12px;
    color: #888;
}

.revenue-card {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8d6 100%);
}

.revenue-card .metric-value {
    font-size: 26px;
    color: #ff9966;
    font-weight: 700;
}

.profit-card {
    background: linear-gradient(135deg, #f0e0f5 0%, #e8d0ed 100%);
}

.profit-card .metric-value {
    font-size: 26px;
    color: #c994d4;
    font-weight: 700;
}

.expense-card {
    background: linear-gradient(135deg, #d4e8f7 0%, #c5e3f6 100%);
}

.expense-card .metric-value {
    font-size: 26px;
    color: #5b8dd9;
    font-weight: 700;
}

.metric-change {
    display: inline;
    font-size: 11px;
    font-weight: 600;
    color: #52b788;
}

/* Revenue Overview Chart */
.revenue-overview {
    grid-column: 2 / 4;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.revenue-overview .card-title {
    margin-bottom: 18px;
}

.revenue-overview canvas {
    flex-grow: 1;
    max-height: 280px;
}

/* Inventory Section */
.inventory-section {
    width: 100%;
}

.inventory-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.inventory-card .card-title {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.inventory-table-wrapper {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-table thead {
    background: #f5ede3;
}

.inventory-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    color: #6b4423;
    font-size: 12px;
    border: none;
}

.inventory-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0e8df;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.inventory-table tbody tr:hover {
    background: #faf7f3;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 10px;
    text-transform: capitalize;
}

.status.critical {
    background: #ffcdd2;
    color: #c62828;
}

.status.low {
    background: #ffe0b2;
    color: #e65100;
}

.status.watch {
    background: #fff9c4;
    color: #f57f17;
}

.action {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 10px;
    text-transform: capitalize;
}

.action.critical {
    background: #ffcdd2;
    color: #c62828;
}

.action.low {
    background: #ffe0b2;
    color: #e65100;
}

.action.watch {
    background: #fff9c4;
    color: #f57f17;
}

.resolve-btn {
    background: #6b4423;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    align-self: flex-start;
    margin-top: 20px;
    flex-shrink: 0;
}

.resolve-btn:hover {
    background: #5a3818;
}

.resolve-btn:disabled {
    background: #c9b5a0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.resolve-btn:disabled:hover {
    background: #c9b5a0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #f0e8df;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #6b4423;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #6b4423;
}

.modal-body {
    padding: 25px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #f0e8df;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'DM Sans', sans-serif;
}

.btn-primary {
    background: #6b4423;
    color: white;
}

.btn-primary:hover {
    background: #5a3818;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 68, 35, 0.3);
}

.btn-secondary {
    background: #f0e8df;
    color: #6b4423;
}

.btn-secondary:hover {
    background: #e8dfd0;
    transform: translateY(-2px);
}

.unit-input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 2px solid #e8dfd0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    margin-top: 12px;
    transition: border-color 0.3s;
}

.unit-input:focus {
    outline: none;
    border-color: #6b4423;
    box-shadow: 0 0 0 3px rgba(107, 68, 35, 0.1);
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.item-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-input-group label {
    font-weight: 600;
    color: #6b4423;
    min-width: 120px;
    font-size: 13px;
}

.item-input-group input {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    border: 2px solid #e8dfd0;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.3s;
}

.item-input-group input:focus {
    outline: none;
    border-color: #6b4423;
    box-shadow: 0 0 0 3px rgba(107, 68, 35, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 1fr 1fr;
    }

    .right-column {
        grid-column: 2;
    }

    .revenue-overview {
        grid-column: 1 / 3;
    }
}

@media (max-width: 768px) {
    .top-section {
        grid-template-columns: 1fr;
    }

    .right-column,
    .center-column,
    .revenue-overview {
        grid-column: 1;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-text h1 {
        font-size: 22px;
    }

    .metric-row {
        grid-template-columns: 1fr;
    }

    .metric-row-small {
        grid-template-columns: 1fr;
    }

    .metric-card {
        flex-direction: column;
        text-align: center;
    }

    .inventory-table {
        font-size: 11px;
    }

    .inventory-table th,
    .inventory-table td {
        padding: 10px;
    }
}
