/* ===== FlowTok Ads — Desktop Layout (≥1024px) ===== */

@media (min-width: 1024px) {

  /* ===== App container: flex row for sidebar + content ===== */
  .app {
    display: flex;
    max-width: 100%;
    margin: 0;
  }

  /* ===== Desktop Sidebar ===== */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-width: 240px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    z-index: 300;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 24px;
  }

  .sidebar-logo-text {
    font-size: 17px;
    font-weight: var(--font-bold);
    color: var(--text-primary);
  }

  .sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: var(--font-regular);
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    text-align: left;
    width: 100%;
  }

  .sidebar-nav-item:hover {
    background: var(--bg-light);
  }

  .sidebar-nav-item.active {
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: var(--font-medium);
  }

  .sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-circle);
    background: #C4B5A0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
  }

  .sidebar-user-info {
    flex: 1;
    min-width: 0;
  }

  .sidebar-user-name {
    font-size: 13px;
    font-weight: var(--font-medium);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-user-email {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ===== Hide mobile elements ===== */
  .tab-bar {
    display: none !important;
  }

  .status-bar {
    display: none !important;
  }

  /* ===== Screen system ===== */
  .screen {
    display: none !important;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
  }

  .screen.active {
    display: block !important;
  }

  /* Hide fixed elements inside inactive screens */
  .screen:not(.active) .chat-input-bar,
  .screen:not(.active) .fab {
    display: none !important;
  }

  /* ===== Headers ===== */
  /* Sidebar already has logo + avatar, hide them from in-page headers */
  .header .logo-svg {
    display: none;
  }

  .header .header-avatar {
    display: none;
  }

  .header {
    max-width: none;
    padding: 20px 32px 16px;
    justify-content: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
  }

  .header-title {
    text-align: left;
    flex: none;
    font-size: 22px;
    font-weight: var(--font-bold);
  }

  .header-back {
    margin-right: 4px;
  }

  .header-divider {
    display: none;
  }

  /* ===== Login screen — centered card ===== */
  .app.no-sidebar {
    justify-content: center;
    align-items: flex-start;
    background: var(--bg-light);
  }

  .app.no-sidebar .desktop-sidebar {
    display: none;
  }

  .app.no-sidebar #screen-login {
    max-width: 440px;
    margin: 60px auto 0;
    min-height: auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.08);
    overflow: hidden;
  }

  .app.no-sidebar #screen-login .login-hero {
    height: 180px;
    min-height: 180px;
    border-radius: 0;
  }

  .app.no-sidebar #screen-login .login-content {
    margin-top: -20px;
    border-radius: 20px 20px 0 0;
    padding: 28px 32px 36px;
  }

  /* ===== Choice screen — centered ===== */
  .app.no-sidebar #screen-choice {
    max-width: 600px;
    margin: 60px auto 0;
    min-height: auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0,0,0,0.08);
  }

  .app.no-sidebar #screen-choice .choice-section {
    height: 280px;
  }

  /* ===== Dashboard (Profile screen) ===== */
  .balance-section {
    max-width: none;
    padding: 12px 32px;
  }

  .balance-info .balance-amount {
    font-size: 28px;
  }

  #campaigns-container {
    padding: 0 8px;
  }

  .empty-state {
    max-width: none;
    padding-top: 80px;
  }

  /* Campaign & archive grid */
  #campaigns-list,
  #archive-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 16px 24px 40px !important;
  }

  #campaigns-list .card,
  #archive-list .card {
    margin: 0;
    max-width: none;
  }

  .card {
    max-width: none;
    transition: box-shadow 0.2s;
  }

  .card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }

  /* ===== Archive screen ===== */
  #screen-archive > div:first-child {
    border-bottom: none;
  }

  /* ===== Desktop-sized UI components ===== */

  /* Settings list & items — full desktop treatment */
  .settings-list {
    max-width: 720px;
    margin: 16px 32px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #eee;
  }

  .settings-item {
    padding: 20px 28px;
    min-height: 64px;
    transition: background 0.15s;
  }

  .settings-item:hover {
    background: #f8f8fa;
  }

  .settings-item:active {
    background: #f0f0f2;
  }

  .settings-item + .settings-item {
    border-top: 1px solid #f0f0f0;
  }

  .settings-item-left {
    gap: 18px;
  }

  .settings-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .settings-item-icon svg {
    width: 22px;
    height: 22px;
  }

  .settings-item-title {
    font-size: 17px;
    font-weight: var(--font-medium);
  }

  .settings-item-subtitle {
    font-size: 14px;
    margin-top: 2px;
  }

  .settings-item-arrow {
    font-size: 24px;
    color: #c0c0c4;
  }

  /* Toggle switch — bigger */
  .toggle {
    width: 56px;
    height: 34px;
    border-radius: 17px;
  }

  .toggle::after {
    width: 30px;
    height: 30px;
  }

  .toggle.active::after {
    transform: translateX(22px);
  }

  /* Input fields — spacious */
  .input-field {
    height: 54px;
    font-size: 16px;
    border-radius: 12px;
    padding: 0 20px;
  }

  textarea.input-field {
    height: 130px;
    padding: 16px 20px;
    font-size: 16px;
  }

  .input-label {
    font-size: 14px;
    margin-bottom: 10px;
    letter-spacing: 0;
  }

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

  /* Buttons — larger */
  .btn {
    height: 54px;
    font-size: 16px;
    border-radius: 14px;
    font-weight: var(--font-semibold);
  }

  .btn-sm {
    height: 46px;
    font-size: 15px;
  }

  /* Cards — more spacious */
  .card {
    padding: 28px 32px;
    border-radius: 16px;
    border: 1px solid #eee;
  }

  .card-label {
    font-size: 14px;
  }

  .card-value {
    font-size: 16px;
  }

  .card-value-bold {
    font-size: 17px;
  }

  .card-divider {
    margin: 20px -32px;
  }

  .card-header {
    margin-bottom: 12px;
  }

  /* Stats grid inside cards */
  .stats-grid {
    gap: 24px;
  }

  .stat-value {
    font-size: 17px;
  }

  .stat-label {
    font-size: 12px;
  }

  /* Balance section */
  .balance-info .balance-label {
    font-size: 16px;
  }

  .balance-topup {
    height: 46px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 12px;
  }

  /* Empty state */
  .empty-state-illustration {
    width: 220px;
    height: 220px;
  }

  .empty-state-title {
    font-size: 24px;
  }

  .empty-state-text {
    font-size: 17px;
    max-width: 360px;
  }

  .empty-state .btn {
    width: auto;
    min-width: 240px;
  }

  /* Overview rows */
  .overview-row {
    padding: 18px 0;
  }

  .overview-label {
    font-size: 16px;
  }

  .overview-value {
    font-size: 16px;
  }

  /* Profile extended */
  .profile-user {
    gap: 20px;
    margin-bottom: 24px;
  }

  .profile-user-email {
    font-size: 15px;
  }

  /* Payment methods */
  .payment-method {
    padding: 18px 0;
    gap: 18px;
  }

  .payment-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 26px;
  }

  .payment-name {
    font-size: 17px;
  }

  .payment-detail {
    font-size: 14px;
  }

  .payment-check {
    width: 26px;
    height: 26px;
  }

  /* Top-up amount buttons */
  .topup-amount-grid {
    gap: 12px;
  }

  .topup-amount-btn {
    height: 52px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Period selector */
  .period-option {
    height: 44px;
    font-size: 15px;
    border-radius: 22px;
  }

  /* Date inputs */
  .date-input {
    height: 52px;
    font-size: 16px;
    border-radius: 12px;
  }

  .date-separator {
    font-size: 18px;
  }

  /* Budget slider */
  .budget-slider::-webkit-slider-thumb {
    width: 34px;
    height: 34px;
  }

  .budget-range {
    font-size: 14px;
    margin-top: 12px;
  }

  /* Campaign step indicator */
  .campaign-step-dot {
    height: 6px;
    border-radius: 3px;
  }

  /* Chat messages */
  .chat-message {
    font-size: 16px;
    padding: 14px 20px;
    border-radius: 20px;
  }

  .chat-time {
    font-size: 13px;
    margin: 12px 0;
  }

  .chat-input {
    height: 48px;
    font-size: 16px;
    border-radius: 24px;
    padding: 0 22px;
  }

  .chat-send-btn {
    width: 48px;
    height: 48px;
  }

  .chat-send-btn svg {
    width: 22px;
    height: 22px;
  }

  /* Notification items */
  .notification-item {
    padding: 18px 28px;
    gap: 18px;
  }

  .notification-avatar {
    width: 48px;
    height: 48px;
  }

  .notification-text {
    font-size: 16px;
  }

  .notification-time {
    font-size: 13px;
  }

  /* FAB */
  .fab {
    width: 64px;
    height: 64px;
    border-radius: 32px;
  }

  .fab svg {
    width: 26px;
    height: 26px;
  }

  /* Login elements */
  .login-title {
    font-size: 26px;
  }

  .login-footer p {
    font-size: 15px;
  }

  /* Choice screen text */
  .choice-section .choice-text {
    font-size: 30px;
    max-width: 300px;
  }

  .choice-section .btn-white {
    height: 52px;
    padding: 0 36px;
    font-size: 17px;
  }

  /* ===== Settings screen ===== */
  #screen-settings > div:nth-child(2) {
    padding: 8px 0 40px;
  }

  /* ===== Notifications screen ===== */
  #screen-notifications > div:nth-child(3) {
    padding: 0 32px;
    max-width: 720px;
  }

  /* ===== Campaign creation — Settings step ===== */
  .campaign-step-indicator {
    max-width: 720px;
    padding: 0 32px;
  }

  .campaign-form {
    max-width: 720px;
    padding: 0 32px;
  }

  .campaign-form h3 {
    font-size: 22px;
  }

  .campaign-form .input-field {
    max-width: 500px;
  }

  .campaign-form textarea.input-field {
    max-width: 500px;
  }

  .campaign-form select.input-field {
    max-width: 500px;
  }

  .campaign-form .btn {
    max-width: 260px;
  }

  /* ===== Campaign creation — Budget step ===== */
  .period-selector {
    max-width: 440px;
  }

  .date-row {
    max-width: 440px;
  }

  .budget-slider-container {
    max-width: 500px;
  }

  .budget-value {
    font-size: 40px;
    text-align: left;
  }

  /* ===== Campaign overview ===== */
  .overview-section {
    max-width: 720px;
    margin: 16px 32px;
    padding: 28px 32px;
    border: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }

  .overview-section h3 {
    font-size: 22px;
  }

  #screen-campaign-overview .content-padded {
    max-width: 720px;
    padding: 0 32px;
  }

  #screen-campaign-overview .content-padded .btn {
    max-width: 260px;
  }

  #screen-campaign-overview .content-padded .btn-outline {
    max-width: 260px;
  }

  /* ===== Profile extended ===== */
  .profile-card {
    max-width: 720px;
    margin: 16px 32px;
    padding: 28px 32px;
    border: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }

  .profile-user-avatar {
    width: 72px;
    height: 72px;
  }

  .profile-user-name {
    font-size: 20px;
  }

  #screen-profile-ext .settings-item .input-field {
    max-width: 420px;
  }

  #screen-profile-ext .content-padded .btn {
    max-width: 260px;
  }

  /* ===== Top up screen ===== */
  #screen-topup .content-padded {
    max-width: 720px;
    padding: 24px 32px;
  }

  .topup-amount-grid {
    max-width: 500px;
  }

  .payment-method {
    max-width: 500px;
  }

  #screen-topup .btn-primary {
    max-width: 320px;
  }

  /* ===== Top up — Add card ===== */
  #screen-topup-add .content-padded {
    max-width: 720px;
    padding: 24px 32px;
  }

  #screen-topup-add .input-field {
    max-width: 420px;
  }

  #screen-topup-add .btn {
    max-width: 260px;
  }

  /* ===== Content padded — general ===== */
  .content-padded {
    max-width: 720px;
    padding-left: 32px;
    padding-right: 32px;
  }

  /* ===== Support / Chat ===== */
  #screen-support.active {
    display: flex !important;
    flex-direction: column;
  }

  #screen-support > div:first-child {
    border-bottom: none;
  }

  .support-chat {
    max-width: 720px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .chat-message {
    max-width: 55%;
  }

  .chat-input-bar {
    left: 240px;
    max-width: calc(100% - 240px);
    padding: 12px 32px 20px;
  }

  .chat-input-bar .chat-input {
    max-width: 680px;
  }

  .app.no-sidebar .chat-input-bar {
    left: 0;
    max-width: 100%;
  }

  /* ===== FAB position ===== */
  .fab {
    right: 32px;
    bottom: 32px;
  }

  #screen-support .fab {
    display: none;
  }
}

/* ===== Hide sidebar on mobile/tablet ===== */
@media (max-width: 1023px) {
  .desktop-sidebar {
    display: none !important;
  }
}
