:root {
    --bg-main: #F8F9FA;
    --bg-card: #FFFFFF;
    --gold: #C5A059;
    --gold-dark: #8B733D;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border-color: #EAEAEA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #CBD5E1; /* Outer background - slightly darker to make the white phone frame pop */
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px; /* Space around the phone frame */
}

.mobile-container {
    width: 100%;
    max-width: 414px;
    height: 850px; 
    max-height: 95vh;
    background-color: var(--bg-main);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    
    /* Hardware Phone Frame Styling */
    border-radius: 40px;
    border: 12px solid #FFFFFF; /* White phone bezel */
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.3), /* Large soft shadow */
        inset 0 0 10px rgba(0,0,0,0.05); /* Inner screen shadow */
}

/* Hide scrollbar for a cleaner phone look */
.mobile-container::-webkit-scrollbar {
    display: none;
}
.mobile-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Premium Login Screen */
.login-header {
    text-align: center;
    padding: 50px 20px 30px;
}

.login-header h1 {
    color: var(--gold-dark);
    font-size: 30px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: var(--bg-card);
    border-radius: 30px 30px 0 0;
    flex-grow: 1;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.03);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 600;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.input-group select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23c5a059" viewBox="0 0 16 16"><path d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    cursor: pointer;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--gold);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #FFFFFF;
    font-weight: bold;
    font-size: 16px;
    padding: 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.3);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 4px 10px rgba(197, 160, 89, 0.2);
}

.error-msg {
    color: #E74C3C;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* If actually viewed on a small mobile device, remove the phone frame */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    .mobile-container {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
}

.forgot-password {
    text-align: center;
    margin-top: 5px;
}

.forgot-password a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

.forgot-password a:hover {
    color: var(--gold-dark);
}

.success-msg {
    color: #27AE60;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    background-color: rgba(39, 174, 96, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

/* Dashboard Styling */
.dashboard-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #FFFFFF;
    padding: 40px 20px 20px;
    border-radius: 0 0 25px 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.2);
    margin-bottom: 10px;
}

.user-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-info p {
    font-size: 13px;
    opacity: 0.9;
}

.logout-btn {
    background-color: rgba(255,255,255,0.2);
    color: #FFF;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s;
}

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

.dashboard-content {
    padding: 20px;
    flex-grow: 1;
}

/* Custom Dropdown UI */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.dashboard-content .custom-select-wrapper {
    width: auto;
    min-width: 130px;
}

.custom-select-trigger {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 15px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.dashboard-content .custom-select-trigger {
    background-color: #FFFBEA;
    border-color: var(--gold);
    color: var(--gold-dark);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(197, 160, 89, 0.1);
}

.custom-select-trigger:after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%23c5a059" viewBox="0 0 16 16"><path d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s;
    margin-left: 10px;
}

.custom-select-wrapper.open .custom-select-trigger:after {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}

.dashboard-content .custom-options {
    right: 0;
    left: auto;
    min-width: 150px;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 15px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover, .custom-option.selected {
    background: #FFFBEA;
    color: var(--gold-dark);
}
.custom-option.selected {
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 20px 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card.full-width {
    grid-column: span 2;
    padding: 25px 15px;
}

.stat-card h3 {
    color: var(--text-main);
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card h3.due-amount {
    color: #E74C3C;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: 700;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    padding: 18px;
    border-radius: 15px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.primary-action {
    border: 2px solid var(--gold);
    background: linear-gradient(to right, rgba(197, 160, 89, 0.05), transparent);
}

.action-btn .icon {
    width: 50px;
    height: 50px;
    background-color: #F8F9FA;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    color: var(--gold-dark);
    margin-right: 15px;
}

.action-btn.primary-action .icon {
    background-color: var(--gold);
    color: #FFF;
    font-size: 26px;
}

.action-btn .text h4 {
    color: var(--text-main);
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 700;
}

.action-btn .text p {
    color: var(--text-muted);
    font-size: 12px;
}

/* Page Header (Common) */
.page-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #FFFFFF;
    padding: 30px 20px 20px;
    border-radius: 0 0 25px 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.2);
    margin-bottom: 20px;
}

.page-header .back-btn {
    color: #FFF;
    text-decoration: none;
    font-size: 24px;
    margin-right: 15px;
    font-weight: bold;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
}

/* Forms & Preview */
/* Hide number input spinners for a cleaner UI */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none !important; 
    margin: 0 !important; 
}
input[type=number] {
    -moz-appearance: textfield;
}

.form-container {
    padding: 0 20px 20px;
    flex-grow: 1;
}

.image-preview-container {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-card);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.image-preview-container .placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
}

.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    font-weight: bold;
    font-size: 15px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    display: block;
    transition: all 0.3s;
}
.btn-secondary:active { background-color: var(--border-color); }

/* Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding-bottom: 20px;
}

.catalog-item {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

.catalog-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.catalog-item .item-details {
    padding: 12px;
}

.catalog-item h4 {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-small {
    background: rgba(0,0,0,0.2);
    color: #FFF;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.delete-link {
    background: none;
    border: none;
    color: #E74C3C;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    margin-top: 6px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.delete-link:active {
    opacity: 1;
}

/* Custom Modal (Bottom Sheet) */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 9999;
    backdrop-filter: blur(4px);
    border-radius: inherit;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    padding: 30px 25px 40px;
    border-radius: 25px 25px 0 0;
    text-align: center;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal-content h3 {
    color: var(--text-main);
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: #F1F5F9;
    color: var(--text-main);
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-cancel:active { background: #E2E8F0; }

.btn-danger {
    flex: 1;
    padding: 14px;
    background: #E74C3C;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}
.btn-danger:active { background: #C0392B; }

/* Order Form Sections */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.form-section-title {
    font-size: 15px;
    color: var(--gold-dark);
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
}
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-main);
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #F8F9FA;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Order List Styling */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

.order-card {
    background: var(--bg-card);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
}

.order-status {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.order-body {
    display: flex;
    padding: 15px;
    gap: 15px;
}

.order-thumb {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.order-info h4 {
    font-size: 17px;
    color: var(--text-main);
    margin-bottom: 4px;
    font-weight: 700;
}

.order-info .phone {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.order-info .design-name {
    font-size: 13px;
    color: var(--gold-dark);
    font-weight: 600;
}

.order-footer {
    display: flex;
    border-top: 1px dashed var(--border-color);
    padding: 12px 15px;
    background: #F8F9FA;
}

.due-box, .date-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.date-box {
    align-items: flex-end;
}

.order-footer .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}

.due-box .amount {
    font-size: 16px;
    font-weight: 700;
}

.date-box .date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}
