:root {
    --indigo-deep: #1a3a5c;
    --indigo-medium: #2d5a87;
    --indigo-light: #4a7fad;
    --ocean-light: #e8f4f8;
    --ocean-mist: #d4e9f0;
    --sand: #f5f0e8;
    --sand-dark: #e8dfd0;
    --wood: #8b6f47;
    --wood-light: #a88a5b;
    --fish-silver: #c4d4dc;
    --coral: #e07a5f;
    --coral-light: #f4a261;
    --white: #fefefe;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-light: #8899a6;
    --success: #2ecc71;
    --shadow-soft: rgba(26, 58, 92, 0.08);
    --shadow-medium: rgba(26, 58, 92, 0.15);
}

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

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background: linear-gradient(135deg, var(--sand) 0%, var(--ocean-light) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow: auto;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(74, 127, 173, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(224, 122, 95, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    background: linear-gradient(135deg, var(--sand) 0%, var(--ocean-light) 100%);
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(26, 58, 92, 0.2);
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.15);
}

.login-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--indigo-deep);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto 1fr;
    height: 100vh;
    gap: 0;
}

/* Header */
.header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo-medium) 100%);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo-text {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.1em;
}

.logo-subtitle {
    font-size: 0.6875rem;
    color: var(--fish-silver);
    letter-spacing: 0.15em;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-btn {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.header-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    padding: 1.25rem;
    overflow-y: auto;
}

.calendar-section {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 24px var(--shadow-soft);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo-medium) 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.calendar-nav-btn:hover {
    background: rgba(255,255,255,0.25);
}

.calendar-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.05em;
}

.today-btn {
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.today-btn:hover {
    background: rgba(255,255,255,0.25);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    overflow: hidden;
}

.calendar-weekday {
    padding: 0.625rem 0.25rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--sand);
    border-bottom: 1px solid var(--sand-dark);
}

.calendar-weekday:first-child { color: var(--coral); }
.calendar-weekday:last-child { color: var(--indigo-light); }

.calendar-day {
    min-height: 80px;
    padding: 0.375rem;
    border: 1px solid var(--sand-dark);
    border-top: none;
    border-left: none;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.calendar-day:nth-child(7n+1) { border-left: 1px solid var(--sand-dark); }
.calendar-day:hover { background: var(--ocean-light); }
.calendar-day.other-month { background: var(--sand); opacity: 0.5; }
.calendar-day.today { background: linear-gradient(135deg, var(--ocean-light) 0%, var(--ocean-mist) 100%); }
.calendar-day.today .day-number {
    background: #a8c8e0;
    color: var(--indigo-deep);
    font-weight: 600;
    padding: 2px 4px;
    line-height: 1;
}
.calendar-day.has-data { background: linear-gradient(135deg, #f8fdf9 0%, #f0f9f4 100%); }
.calendar-day.holiday { background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%); }
.calendar-day.holiday .day-number { color: var(--coral) !important; }
.calendar-day.holiday .holiday-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.5rem;
    color: var(--coral);
    background: rgba(224, 122, 95, 0.15);
    padding: 1px 3px;
    border-radius: 2px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-number {
    font-size: 0.75rem;
    font-weight: 500;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-bottom: 0.125rem;
}

.calendar-day:nth-child(7n+1) .day-number { color: var(--coral); }
.calendar-day:nth-child(7n) .day-number { color: var(--indigo-light); }

.day-sales {
    font-size: 0.5625rem;
    line-height: 1.3;
}

.day-sales-item {
    display: flex;
    justify-content: space-between;
    padding: 1px 3px;
    border-radius: 2px;
    margin-bottom: 1px;
}

.day-sales-item.lunch { background: rgba(244, 162, 97, 0.2); color: var(--coral); }
.day-sales-item.dinner { background: rgba(45, 90, 135, 0.15); color: var(--indigo-medium); }
.day-sales-item.total { background: var(--indigo-deep); color: var(--white); font-weight: 500; margin-top: 2px; }

.day-fishing-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.75rem;
}

/* Sidebar */
.sidebar {
    background: var(--white);
    border-left: 1px solid var(--sand-dark);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid var(--sand-dark);
}

.sidebar-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--indigo-deep);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, var(--indigo-medium) 0%, var(--coral) 100%);
    border-radius: 2px;
}

.period-selector {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.period-btn {
    flex: 1;
    padding: 0.375rem;
    border: 1px solid var(--sand-dark);
    border-radius: 6px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn.active {
    background: var(--indigo-deep);
    color: var(--white);
    border-color: var(--indigo-deep);
}

.summary-card {
    background: linear-gradient(135deg, var(--sand) 0%, var(--ocean-light) 100%);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.summary-card:last-child { margin-bottom: 0; }
.summary-card.clickable { cursor: pointer; transition: all 0.2s ease; }
.summary-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow-soft); }

.summary-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin-bottom: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--indigo-deep);
}

.summary-value.expense { color: var(--coral); }
.summary-value.profit { color: var(--success); }

.summary-sub {
    font-size: 0.625rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.summary-grid .summary-card { margin-bottom: 0; }

.fishing-stat {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    background: var(--sand);
    border-radius: 8px;
    margin-bottom: 0.375rem;
}

.fishing-stat:last-child { margin-bottom: 0; }
.fishing-icon { font-size: 1.25rem; }

.fishing-info { flex: 1; }
.fishing-label { font-size: 0.625rem; color: var(--text-secondary); }
.fishing-value { font-size: 0.9375rem; font-weight: 600; color: var(--indigo-deep); }

/* Quick Actions */
.quick-actions {
    padding: 1rem;
    margin-top: auto;
    background: var(--sand);
}

.action-btn {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.action-btn:last-child { margin-bottom: 0; }

.action-btn.primary {
    background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo-medium) 100%);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(26, 58, 92, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(26, 58, 92, 0.4);
}

.action-btn.secondary {
    background: var(--white);
    color: var(--indigo-deep);
    border: 1px solid var(--sand-dark);
}

.action-btn.secondary:hover { background: var(--ocean-light); }

.action-btn.fishing {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
    color: var(--white);
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 58, 92, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

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

.modal {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all 0.25s ease;
    box-shadow: 0 20px 60px rgba(26, 58, 92, 0.3);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo-medium) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header.fishing-header {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
}

.modal-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body { padding: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--sand-dark);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--indigo-medium);
    box-shadow: 0 0 0 3px rgba(45, 90, 135, 0.1);
}

.form-input::placeholder { color: var(--text-light); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.modal-footer {
    padding: 0.875rem 1.25rem 1.25rem;
    display: flex;
    gap: 0.625rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.cancel {
    background: var(--sand);
    color: var(--text-secondary);
}

.modal-btn.cancel:hover { background: var(--sand-dark); }

.modal-btn.submit {
    background: linear-gradient(135deg, var(--indigo-deep) 0%, var(--indigo-medium) 100%);
    color: var(--white);
}

.modal-btn.submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.3);
}

.modal-btn.delete {
    background: var(--coral);
    color: var(--white);
}

/* Tab selector */
.tab-selector {
    display: flex;
    background: var(--sand);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1rem;
}

.tab-option {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-option.active {
    background: var(--white);
    color: var(--indigo-deep);
    box-shadow: 0 2px 6px var(--shadow-soft);
}

/* Menu list styles */
.menu-list { margin-bottom: 0.5rem; }
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    background: var(--sand);
    border-radius: 6px;
    margin-bottom: 0.375rem;
}
.menu-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.menu-item-name { font-size: 0.8125rem; color: var(--text-primary); }
.menu-item-price { font-size: 0.75rem; color: var(--text-secondary); }
.menu-item-controls {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.qty-btn.minus { background: var(--sand-dark); color: var(--text-secondary); }
.qty-btn.plus { background: var(--indigo-medium); color: var(--white); }
.qty-btn:hover { transform: scale(1.1); }
.qty-display {
    min-width: 28px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--indigo-deep);
}
.menu-item-subtotal {
    min-width: 60px;
    text-align: right;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--indigo-deep);
}
.add-other-btn {
    width: 100%;
    padding: 0.5rem;
    border: 2px dashed var(--sand-dark);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.add-other-btn:hover {
    border-color: var(--indigo-medium);
    color: var(--indigo-medium);
}
.other-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    align-items: center;
}
.other-item input {
    padding: 0.5rem;
    border: 1px solid var(--sand-dark);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.8125rem;
}
.other-item input.name { flex: 2; }
.other-item input.price { flex: 1; width: 80px; }
.other-item input.cost { flex: 1; width: 80px; }
.other-item input.qty { width: 50px; text-align: center; }
.other-item-delete {
    background: none;
    border: none;
    color: var(--coral);
    cursor: pointer;
    font-size: 1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Data display */
.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px dashed var(--sand-dark);
    font-size: 0.75rem;
}

.data-row:last-child { border-bottom: none; }
.data-label { color: var(--text-secondary); }
.data-value { font-weight: 600; color: var(--indigo-deep); }

/* Expense list */
.expense-list {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.expense-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem;
    background: var(--sand);
    border-radius: 6px;
    margin-bottom: 0.375rem;
}

.expense-item:last-child { margin-bottom: 0; }
.expense-name { font-size: 0.8125rem; color: var(--text-primary); }
.expense-amount { font-size: 0.875rem; font-weight: 600; color: var(--coral); }

.expense-delete {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(224, 122, 95, 0.2);
    color: var(--coral);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.expense-delete:hover {
    background: var(--coral);
    color: var(--white);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--indigo-deep);
    color: var(--white);
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    box-shadow: 0 8px 32px rgba(26, 58, 92, 0.4);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--sand); }
::-webkit-scrollbar-thumb { background: var(--sand-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.calendar-section { animation: fadeIn 0.4s ease; }

/* Responsive - Mobile */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        border-left: none;
        border-top: 1px solid var(--sand-dark);
    }

    .main-content {
        min-height: 50vh;
    }

    .calendar-day {
        min-height: 60px;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .header-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .header-btn span {
        display: none;
    }

    .calendar-day {
        min-height: 50px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.6875rem;
        width: 18px;
        height: 18px;
    }

    .day-sales {
        font-size: 0.5rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
    }
}
